From 819f56391cba68c1b99efacb8ecb1a31d43863aa Mon Sep 17 00:00:00 2001 From: jiapengyu Date: Mon, 27 Jul 2026 13:46:06 +0800 Subject: [PATCH] Initial commit - huishou project --- git-push.js | 14 ++------------ test-ssh.js | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 test-ssh.js diff --git a/git-push.js b/git-push.js index b4b5150a..8d254188 100644 --- a/git-push.js +++ b/git-push.js @@ -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); } diff --git a/test-ssh.js b/test-ssh.js new file mode 100644 index 00000000..1d8c6f49 --- /dev/null +++ b/test-ssh.js @@ -0,0 +1,14 @@ +const { execSync } = require('child_process'); + +try { + console.log('=== Testing SSH without host key checking ==='); + const result = execSync('ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -T git@git.torchcloud.cn', { + stdio: ['inherit', 'inherit', 'inherit'], + timeout: 30000, + cwd: __dirname + }); + console.log('=== SSH connection successful ==='); +} catch (error) { + console.error('=== SSH connection failed ==='); + console.error('Exit code:', error.status); +}