Repository: Wulf/create-rust-app (language: rust)

Issue:
No such file or directory error from project.rs
The create-rust-app cli is always giving me this error: 

`thread 'main' panicked at 'failed to execute process: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /Users/jarviskennedy/.cargo/registry/src/github.com-1ecc6299db9ec823/create-rust-app_cli-9.0.0/src/content/project.rs:274:10`



Discussion / hints:
hey @Jarvismkennedy, hope things are well :)

Sorry you ran into this. Could I ask which commands you ran exactly? For example, the following is working for me:

```sh
cargo install create-rust-app_cli

create-rust-app my-project 
# all plugins enabled, using all permutations of actix-web/poem/sqlite/postgres
```
Hey, thanks for the response!

I ran `cargo install create-rust-app_cli`, and then `create-rust-app my_project` and I get this error with any permutation of options I choose. The error is always the same, at project.rs:274:10.
:thinking: that's really strange. Could you run:

```
create-rust-app --version
```
Yes, I am on version 9.0.0
~What does the following return?~

```
tree /Users/jarviskennedy/.cargo/registry/src/github.com-1ecc6299db9ec823/create-rust-app_cli-9.0.0/
```

~(you can `brew install tree` if necessary)~

EDIT: I was able to reproduce this whilst trying to test my local changes to `create-rust-app_cli`:

```
thread 'main' panicked at 'failed to execute process: Os { code: 2, kind: NotFound, message: "No such file or directory" }', create-rust-app_cli/src/utils/git.rs:11:10
```

Update: It seems we've changed the order of git commands -- was [this](https://github.com/Wulf/create-rust-app/commit/bf46fa090249bd40e5e9d172ad027eb54dc9879b#diff-39d2748a92ddeabb1484bfec89431c0a0c3e79feb7a110241fed570fa7e8da7cR263) necessary for the CI setup @AnthonyMichaelTDM ? It's completely broken the normal flow (since we need to create an initialize the git directory before asking the user for their name/email). Hmm, continued to check and it shouldn't be necessary since we modify the global git [config](https://github.com/Wulf/create-rust-app/commit/bf46fa090249bd40e5e9d172ad027eb54dc9879b#diff-2d3e26ba7cc72eb42c62f25e5f444434c9e8245723ad4fdc1cb013d84961f9aeR42). Going to revert this move~

Alright, I'll ship a release as soon as watchexec cuts a release for #140 
I ended up finding and fixing a different bug -- please do share the output of
```
tree /Users/jarviskennedy/.cargo/registry/src/github.com-1ecc6299db9ec823/create-rust-app_cli-9.0.0/
```
when you get a chance. Again, you can `brew install tree` if necessary!
Here is the result: 

├── Cargo.lock
├── Cargo.toml
├── Cargo.toml.orig
├── src
│   ├── content
│   │   ├── cargo_toml.rs
│   │   ├── migration.rs
│   │   ├── mod.rs
│   │   ├── model.rs
│   │   ├── project.rs
│   │   └── service.rs
│   ├── main.rs
│   ├── plugins
│   │   ├── auth.rs
│   │   ├── container.rs
│   │   ├── dev.rs
│   │   ├── graphql.rs
│   │   ├── mod.rs
│   │   ├── storage.rs
│   │   └── utoipa.rs
│   └── utils
│       ├── fs.rs
│       ├── git.rs
│       ├── logger.rs
│       └── mod.rs
├── template
│   ├── README.md
│   ├── backend
│   │   ├── mail
│   │   │   ├── example.rs
│   │   │   └── mod.rs
│   │   ├── main.rs+actix_web
│   │   ├── main.rs+poem
│   │   ├── models
│   │   │   └── mod.rs
│   │   ├── schema.rs
│   │   ├── services
│   │   │   ├── mod.rs
│   │   │   ├── todo.rs+actix_web
│   │   │   └── todo.rs+poem
│   │   └── views
│   │       └── index.html
│   ├── build.rs
│   ├── diesel.toml
│   ├── frontend
│   │   ├── bundles
│   │   │   └── index.tsx
│   │   ├── package-lock.json
│   │   ├── package.json
│   │   ├── playwright.config.ts
│   │   ├── public
│   │   │   ├── images
│   │   │   │   ├── favicon.ico
│   │   │   │   ├── logo192.png
│   │   │   │   └── logo512.png
│   │   │   ├── pwa.json
│   │   │   └── robots.txt
│   │   ├── src
│   │   │   ├── App.css
│   │   │   ├── App.tsx
│   │   │   ├── containers
│   │   │   │   ├── Home.tsx
│   │   │   │   └── Todo.tsx
│   │   │   ├── dev.tsx
│   │   │   ├── hooks
│   │   │   │   └── useQueryParam.ts
│   │   │   ├── images
│   │   │   │   ├── logo.svg
│   │   │   │   ├── logo2.svg
│   │   │   │   └── plus.svg
│   │   │   ├── reportWebVitals.js
│   │   │   └── types
│   │   │       ├── global.d.ts
│   │   │       ├── rust.d.ts
│   │   │       └── untyped-modules.d.ts
│   │   ├── tests
│   │   │   └── example.spec.ts
│   │   ├── tsconfig.json
│   │   └── vite.config.ts
│   └── migrations
│       ├── 00000000000000_diesel_initial_setup
│       │   ├── down.sql+database_postgres
│       │   └── up.sql+database_postgres
│       ├── 00000000000001_utc
│       │   ├── down.sql+database_postgres
│       │   └── up.sql+database_postgres
│       └── 00000000000002_todos
│           ├── down.sql+database_postgres
│           ├── down.sql+database_sqlite
│           ├── up.sql+database_postgres
│           └── up.sql+database_sqlite
├── template-plugin-auth
│   └── frontend
│       ├── src
│       │   ├── containers
│       │   │   ├── AccountPage.tsx
│       │   │   ├── ActivationPage.tsx
│       │   │   ├── LoginPage.tsx
│       │   │   ├── RecoveryPage.tsx
│       │   │   ├── RegistrationPage.tsx
│       │   │   └── ResetPage.tsx
│       │   ├── hooks
│       │   │   └── useAuth.tsx
│       │   └── types
│       │       └── plugin-auth.d.ts
│       └── tests
│           └── authentication.spec.ts
├── template-plugin-container
│   └── Dockerfile
├── template-plugin-dev
│   ├── README.md
│   └── frontend
│       └── src
│           ├── setupDevelopment.tsx
│           └── types
│               └── plugin-dev.d.ts
├── template-plugin-graphql
│   ├── backend
│   │   └── graphql
│   │       ├── mod.rs+actix_web
│   │       ├── mod.rs+poem
│   │       ├── mutation.rs
│   │       ├── query.rs
│   │       └── subscription.rs
│   └── frontend
│       └── src
│           ├── containers
│           │   └── GraphQLPage.tsx
│           └── hooks
│               └── useAuthenticatedApolloClient.ts
└── template-plugin-storage
    ├── backend
    │   └── services
    │       ├── file.rs+actix_web
    │       └── file.rs+poem
    └── frontend
        └── src
            ├── containers
            │   └── Files.tsx
            └── types
                └── plugin-storage.d.ts

Fix patch:
diff --git a/create-rust-app_cli/src/content/project.rs b/create-rust-app_cli/src/content/project.rs
index 57ee6d6e..a54202db 100644
--- a/create-rust-app_cli/src/content/project.rs
+++ b/create-rust-app_cli/src/content/project.rs
@@ -260,6 +260,12 @@ pub fn create(project_name: &str, creation_options: CreationOptions) -> Result<(
         style(&format!("{:?}", creation_options.backend_framework)).yellow()
     ));
 
+    logger::message("Creating Project Directory");
+    match std::fs::create_dir_all(&project_dir) {
+        Ok(_) => {}
+        Err(err) => logger::exit("std::fs::create_dir_all():", err),
+    }
+
     // check if a git user name & email are configured, if not either ask for one or fail if in cli-mode
     logger::command_msg("git config user.name");
     let git_config_user_name = git::check_config(&project_dir, "user.name");
@@ -333,11 +339,6 @@ pub fn create(project_name: &str, creation_options: CreationOptions) -> Result<(
         }
     }
 
-    match std::fs::create_dir_all(&project_dir) {
-        Ok(_) => {}
-        Err(err) => logger::exit("std::fs::create_dir_all():", err),
-    }
-
     logger::command_msg("cargo init");
 
     let cargo_init = std::process::Command::new("cargo")


Test patch: