safe-push 0.1.1 → 0.2.0
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/dist/index.js +5 -4
- package/package.json +1 -1
- package/src/commands/push.ts +6 -4
package/dist/index.js
CHANGED
|
@@ -7046,7 +7046,8 @@ function createCheckCommand() {
|
|
|
7046
7046
|
|
|
7047
7047
|
// src/commands/push.ts
|
|
7048
7048
|
function createPushCommand() {
|
|
7049
|
-
return new Command("push").description("Check and push if allowed").option("-f, --force", "Bypass safety checks").option("--dry-run", "Show what would be pushed without actually pushing").action(async (options) => {
|
|
7049
|
+
return new Command("push").description("Check and push if allowed").option("-f, --force", "Bypass safety checks").option("--dry-run", "Show what would be pushed without actually pushing").allowUnknownOption().action(async (options, command) => {
|
|
7050
|
+
const gitArgs = command.args;
|
|
7050
7051
|
try {
|
|
7051
7052
|
if (!await isGitRepository()) {
|
|
7052
7053
|
printError("Not a git repository");
|
|
@@ -7063,7 +7064,7 @@ function createPushCommand() {
|
|
|
7063
7064
|
printSuccess("Dry run: would push (checks bypassed)");
|
|
7064
7065
|
process.exit(0);
|
|
7065
7066
|
}
|
|
7066
|
-
const result2 = await execPush();
|
|
7067
|
+
const result2 = await execPush(gitArgs);
|
|
7067
7068
|
if (result2.success) {
|
|
7068
7069
|
printSuccess("Push successful");
|
|
7069
7070
|
process.exit(0);
|
|
@@ -7082,7 +7083,7 @@ function createPushCommand() {
|
|
|
7082
7083
|
printSuccess("Dry run: would push (user confirmed)");
|
|
7083
7084
|
process.exit(0);
|
|
7084
7085
|
}
|
|
7085
|
-
const result2 = await execPush();
|
|
7086
|
+
const result2 = await execPush(gitArgs);
|
|
7086
7087
|
if (result2.success) {
|
|
7087
7088
|
printSuccess("Push successful");
|
|
7088
7089
|
process.exit(0);
|
|
@@ -7101,7 +7102,7 @@ function createPushCommand() {
|
|
|
7101
7102
|
printSuccess("Dry run: would push");
|
|
7102
7103
|
process.exit(0);
|
|
7103
7104
|
}
|
|
7104
|
-
const result = await execPush();
|
|
7105
|
+
const result = await execPush(gitArgs);
|
|
7105
7106
|
if (result.success) {
|
|
7106
7107
|
printSuccess("Push successful");
|
|
7107
7108
|
process.exit(0);
|
package/package.json
CHANGED
package/src/commands/push.ts
CHANGED
|
@@ -18,7 +18,9 @@ export function createPushCommand(): Command {
|
|
|
18
18
|
.description("Check and push if allowed")
|
|
19
19
|
.option("-f, --force", "Bypass safety checks")
|
|
20
20
|
.option("--dry-run", "Show what would be pushed without actually pushing")
|
|
21
|
-
.
|
|
21
|
+
.allowUnknownOption()
|
|
22
|
+
.action(async (options: { force?: boolean; dryRun?: boolean }, command: Command) => {
|
|
23
|
+
const gitArgs = command.args;
|
|
22
24
|
try {
|
|
23
25
|
// Gitリポジトリ内か確認
|
|
24
26
|
if (!(await isGitRepository())) {
|
|
@@ -43,7 +45,7 @@ export function createPushCommand(): Command {
|
|
|
43
45
|
process.exit(0);
|
|
44
46
|
}
|
|
45
47
|
|
|
46
|
-
const result = await execPush();
|
|
48
|
+
const result = await execPush(gitArgs);
|
|
47
49
|
if (result.success) {
|
|
48
50
|
printSuccess("Push successful");
|
|
49
51
|
process.exit(0);
|
|
@@ -73,7 +75,7 @@ export function createPushCommand(): Command {
|
|
|
73
75
|
process.exit(0);
|
|
74
76
|
}
|
|
75
77
|
|
|
76
|
-
const result = await execPush();
|
|
78
|
+
const result = await execPush(gitArgs);
|
|
77
79
|
if (result.success) {
|
|
78
80
|
printSuccess("Push successful");
|
|
79
81
|
process.exit(0);
|
|
@@ -96,7 +98,7 @@ export function createPushCommand(): Command {
|
|
|
96
98
|
process.exit(0);
|
|
97
99
|
}
|
|
98
100
|
|
|
99
|
-
const result = await execPush();
|
|
101
|
+
const result = await execPush(gitArgs);
|
|
100
102
|
if (result.success) {
|
|
101
103
|
printSuccess("Push successful");
|
|
102
104
|
process.exit(0);
|