rustic icon indicating copy to clipboard operation
rustic copied to clipboard

Fix cargo new for non-existing directory

Open roife opened this issue 2 years ago • 0 comments

fix #506.

The current implementation of rustic-cargo-new utilizes D within interactive, necessitating an existing path. However, the functionality of cargo new allows arguments for non-existing paths and automatically generates directories.

For instance, when executing cargo new a1/a2 within ~/source, Cargo generates a directory named a1 and a subdirectory a2 within a1. Subsequently, cargo new initializes a package within ~/source/a1/a2.

This proposed patch aims to enhance rustic-cargo-new by enabling acceptance of arbitrary paths. It will then determine the longest existing prefix of the path as the default-directory, utilizing the remainder as the project-name passed to cargo new.

roife avatar Dec 05 '23 07:12 roife