Spaces:
Running
Running
Rifza111
commited on
Commit
·
426c6b5
1
Parent(s):
60208c2
changed
Browse files
up.js
CHANGED
@@ -1,16 +1,10 @@
|
|
1 |
require('dotenv/config')
|
2 |
const { exec } = require('child_process');
|
3 |
|
4 |
-
const readline = require("readline")
|
5 |
const { promisify } = require('util')
|
6 |
|
7 |
-
const rl = readline.createInterface({
|
8 |
-
input: process.stdin,
|
9 |
-
output: process.stdout
|
10 |
-
});
|
11 |
const execPromise = promisify(exec);
|
12 |
|
13 |
-
|
14 |
const execute = (command) => {
|
15 |
return execPromise(command).then(({ stdout, stderr }) => {
|
16 |
if (stderr) {
|
@@ -29,10 +23,7 @@ const push = async (username) => {
|
|
29 |
|
30 |
await execute('git add .');
|
31 |
console.log(await execute('git status'));
|
32 |
-
|
33 |
-
const question = (text) => new Promise((resolve) => rl.question(text, resolve));
|
34 |
-
const info = await question("Commit Info: ");
|
35 |
-
console.log(await execute(`git commit --allow-empty -m "${info}"`));
|
36 |
console.log(await execute('git branch -M main'));
|
37 |
console.log(await execute(`git push https://${username}:${token}@${repoUrl} main --force`));
|
38 |
console.log('Commands executed successfully');
|
|
|
1 |
require('dotenv/config')
|
2 |
const { exec } = require('child_process');
|
3 |
|
|
|
4 |
const { promisify } = require('util')
|
5 |
|
|
|
|
|
|
|
|
|
6 |
const execPromise = promisify(exec);
|
7 |
|
|
|
8 |
const execute = (command) => {
|
9 |
return execPromise(command).then(({ stdout, stderr }) => {
|
10 |
if (stderr) {
|
|
|
23 |
|
24 |
await execute('git add .');
|
25 |
console.log(await execute('git status'));
|
26 |
+
console.log(await execute(`git commit --allow-empty -m "changed"`));
|
|
|
|
|
|
|
27 |
console.log(await execute('git branch -M main'));
|
28 |
console.log(await execute(`git push https://${username}:${token}@${repoUrl} main --force`));
|
29 |
console.log('Commands executed successfully');
|