You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-18Lines changed: 17 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -56,37 +56,36 @@ Options:
56
56
Target directory for cloning the repository (must include the repo name) (defaults to "{current_dir}/{repo_name}") (see also: --workspace)
57
57
-w, --workspace <WORKSPACE>
58
58
Parent of the target directory for cloning the repository (must NOT include the repo name). If this option is specified, then the repo is cloned to "{workspace}/{repo_name}". The --dir option overrides this option
59
-
--shell <SHELL>
59
+
--shell-cmd <SHELL_CMD>
60
60
Shell to use for executing commands [default: /bin/sh]
Copy file name to clipboardExpand all lines: src/lib.rs
+35-45Lines changed: 35 additions & 45 deletions
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ impl RepoVisibility {
28
28
}
29
29
30
30
#[derive(Parser,Setters,Debug)]
31
-
#[command(version, about, author, after_help = "All command arg options support the following substitutions:\n* {{name}} - substituted with --name arg\n")]
31
+
#[command(version, about, author, after_help = "All command arg options support the following substitutions:\n* {{name}} - substituted with --name arg\n* {{dir}} - substituted with resolved directory for repo (the resolved value of --dir)\n")]
32
32
#[setters(into)]
33
33
pubstructCreateRustGithubRepo{
34
34
#[arg(long, short = 'n', help = "Repository name")]
let substitutions = HashMap::<&'staticstr,&str>::from([("{{name}}",self.name.as_str())]);
86
+
let substitutions = HashMap::<&'staticstr,&str>::from([
87
+
("{{name}}",self.name.as_str()),
88
+
("{{dir}}", dir_string.as_str()),
89
+
]);
89
90
90
-
let repo_exists = success(&self.shell,["-c"],[self.repo_exists_cmd],¤t_dir,&substitutions)?;
91
+
let repo_exists = success(&self.shell_cmd,["-c"],[self.repo_exists_cmd],¤t_dir,&substitutions)?;
91
92
92
93
if !repo_exists {
93
94
// Create a GitHub repo
94
-
exec(
95
-
"gh",
96
-
[
97
-
"repo",
98
-
"create",
99
-
&self.name,
100
-
self.visibility.to_gh_create_repo_flag(),
101
-
],
102
-
self.gh_repo_create_args,
103
-
¤t_dir,
104
-
&substitutions,
105
-
)
106
-
.context("Failed to create GitHub repository")?;
95
+
exec(&self.shell_cmd,["-c"],[self.repo_create_cmd],¤t_dir,&substitutions).context("Failed to create repository")?;
107
96
}
108
97
109
98
if !dir.exists(){
110
99
// Clone the repo
111
-
exec("gh",["repo","clone",&self.name, dir.to_str().unwrap()],self.gh_repo_clone_args.into_iter(),¤t_dir,&substitutions).context("Failed to clone repository")?;
100
+
exec(&self.shell_cmd,["-c"],[self.repo_clone_cmd],¤t_dir,&substitutions).context("Failed to clone repository")?;
0 commit comments