+1
-1
| { | ||
| "name": "gitgod", | ||
| "version": "1.2.0", | ||
| "version": "1.2.1", | ||
| "description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+14
-44
@@ -81,5 +81,7 @@ #!/usr/bin/env node | ||
| await runCommand("git add ."); | ||
| await gitCommit("commit by gitgod"); | ||
| await runCommand(`git remote add origin ${ssh}`); | ||
| await runCommand("git fetch"); | ||
| console.log("Setting up a git remote..."); | ||
@@ -97,34 +99,13 @@ await runCommand("git branch --set-upstream-to=origin/main main"); | ||
| const setGit = async (error) => { | ||
| if (error && error.message && find(error.message, "not a git repository")) { | ||
| const github = await askQuestion( | ||
| "Enter Github Repository URL/HTTPS/SSH :- ", | ||
| ); | ||
| const ssh = await convertToSsh(github); | ||
| const gitSync = async () => { | ||
| const message = await askQuestion("Enter commit message :-"); | ||
| console.log("git syncing.."); | ||
| console.log("Git Initializing..."); | ||
| await runCommand("git init"); | ||
| await runCommand("git init"); | ||
| await runCommand("git add ."); | ||
| await gitCommit(message); | ||
| console.log("Setting up a git remote..."); | ||
| await runCommand(`git remote add origin ${ssh}`); | ||
| console.log("Fetching repo data.."); | ||
| await runCommand("git fetch origin"); | ||
| await runCommand("git add ."); | ||
| await gitCommit("commit by gitgod"); | ||
| const { error, stdout, stderr } = await runCommand("git checkout -b main"); | ||
| console.log(error); | ||
| console.log(stdout); | ||
| console.log(stderr); | ||
| await runCommand("git merge master --allow-unrelated-histories --no-edit"); | ||
| console.log("Setting Default Values..."); | ||
| await runCommand("git branch --set-upstream-to=origin/main main"); | ||
| await gitPull(); | ||
| await gitPush(); | ||
| console.log("Git repository synced successfully."); | ||
| } | ||
| await gitPull(); | ||
| await runCommand("git Push"); | ||
| console.log("Git Synced"); | ||
| }; | ||
@@ -137,20 +118,8 @@ | ||
| if (error) { | ||
| //await setGit(error); | ||
| await setGitUsingClone(error); | ||
| } else { | ||
| await gitSync(); | ||
| } | ||
| /*else { | ||
| let command = "git rev-parse --show-toplevel"; | ||
| let { error, stdout, stderr } = await runCommand(command); | ||
| console.log("\ne", error); | ||
| console.log("\ns1", stdout); | ||
| console.log("\ns2", stderr); | ||
| if (error == ) { | ||
| await setGit(error); | ||
| } | ||
| } | ||
| */ | ||
| //console.log(`Git output: ${stdout}`); | ||
| if (stderr) { | ||
| //console.error(`Git error: ${stderr}`); | ||
| } | ||
@@ -161,2 +130,3 @@ | ||
| }; | ||
| main(); |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
3
-25%7419
-12.99%128
-17.95%