gitshift 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/add.js +9 -22
package/package.json
CHANGED
package/src/commands/add.js
CHANGED
|
@@ -26,9 +26,7 @@ export async function addCommand() {
|
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
if (getProfile(name)) {
|
|
29
|
-
error(
|
|
30
|
-
`Profile "${name}" already exists`
|
|
31
|
-
);
|
|
29
|
+
error(`Profile "${name}" already exists`);
|
|
32
30
|
|
|
33
31
|
process.exitCode = 1;
|
|
34
32
|
return;
|
|
@@ -43,35 +41,23 @@ export async function addCommand() {
|
|
|
43
41
|
});
|
|
44
42
|
|
|
45
43
|
const createSSH = await confirm({
|
|
46
|
-
message:
|
|
47
|
-
"Generate SSH key automatically?",
|
|
44
|
+
message: "Generate SSH key automatically?",
|
|
48
45
|
default: true,
|
|
49
46
|
});
|
|
50
47
|
|
|
51
48
|
let sshKey = null;
|
|
52
49
|
|
|
53
50
|
if (createSSH) {
|
|
54
|
-
const spinner = ora(
|
|
55
|
-
"Generating SSH key..."
|
|
56
|
-
).start();
|
|
51
|
+
const spinner = ora("Generating SSH key...").start();
|
|
57
52
|
|
|
58
53
|
try {
|
|
59
|
-
sshKey = await generateSSHKey(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
spinner.succeed(
|
|
65
|
-
"SSH key generated"
|
|
66
|
-
);
|
|
54
|
+
sshKey = await generateSSHKey(name, email);
|
|
55
|
+
|
|
56
|
+
spinner.succeed("SSH key generated");
|
|
67
57
|
} catch (err) {
|
|
68
|
-
spinner.fail(
|
|
69
|
-
"Unable to generate SSH key"
|
|
70
|
-
);
|
|
58
|
+
spinner.fail("Unable to generate SSH key");
|
|
71
59
|
|
|
72
|
-
error(
|
|
73
|
-
"Could not create SSH key. Ensure OpenSSH is installed and available."
|
|
74
|
-
);
|
|
60
|
+
error("Could not create SSH key. Ensure OpenSSH is installed and available.");
|
|
75
61
|
|
|
76
62
|
if (
|
|
77
63
|
err &&
|
|
@@ -100,6 +86,7 @@ export async function addCommand() {
|
|
|
100
86
|
} catch (err) {
|
|
101
87
|
if (err && err.name === "ExitPromptError") {
|
|
102
88
|
// User canceled the prompt (Ctrl+C / SIGINT). Exit gracefully.
|
|
89
|
+
error("Profile creation canceled.");
|
|
103
90
|
process.exitCode = 0;
|
|
104
91
|
return;
|
|
105
92
|
}
|