Initial commit - huishou project
This commit is contained in:
+2
-12
@@ -1,24 +1,13 @@
|
||||
const { execSync } = require('child_process');
|
||||
const fs = require('fs');
|
||||
|
||||
const gitPath = 'D:\\Git\\bin\\git.exe';
|
||||
|
||||
try {
|
||||
console.log('=== Remove lock file ===');
|
||||
const lockFile = 'D:\\Trae\\huishou\\.git\\index.lock';
|
||||
if (fs.existsSync(lockFile)) {
|
||||
fs.unlinkSync(lockFile);
|
||||
console.log('Lock file removed');
|
||||
}
|
||||
|
||||
console.log('=== Add all files ===');
|
||||
execSync(`${gitPath} add .`, { stdio: 'inherit', cwd: __dirname });
|
||||
|
||||
console.log('=== Commit code ===');
|
||||
execSync(`${gitPath} commit -m "Initial commit"`, { stdio: 'inherit', cwd: __dirname });
|
||||
|
||||
console.log('=== Add remote ===');
|
||||
execSync(`${gitPath} remote add origin git@git.torchcloud.cn:jiapengyu/huishou.git`, { stdio: 'inherit', cwd: __dirname });
|
||||
execSync(`${gitPath} commit -m "Initial commit - huishou project"`, { stdio: 'inherit', cwd: __dirname });
|
||||
|
||||
console.log('=== Push to remote ===');
|
||||
execSync(`${gitPath} push -u origin master`, { stdio: 'inherit', cwd: __dirname });
|
||||
@@ -26,5 +15,6 @@ try {
|
||||
console.log('=== Success ===');
|
||||
} catch (error) {
|
||||
console.error('=== Failed ===');
|
||||
console.error('Exit code:', error.status);
|
||||
console.error(error.message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user