diff --git a/.gitignore b/.gitignore index 5e96bb3..f320f93 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,6 @@ npm-debug.log .Spotlight-V100 .Trashes -yarn-error.log \ No newline at end of file +yarn-error.log + +.vscode diff --git a/README.md b/README.md index 4773709..22b9026 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,9 @@ Electron build and auto update service, application distribution. Making applica A git repository corresponds to an electron app and an distributed system. -Electron Distribution server-side work in 64 bit Linux OS (required) and MacOS (optional), and build for x64 platfrom, other platfrom need to modify the code (It is easy). +Electron Distribution server-side work in 64 bit Linux OS (required) and MacOS (optional), and build for x64 platform, other platform need to modify the code (It is easy). + +![Electron Distribution](/preview.png) ## Quick Setup Guide @@ -174,3 +176,7 @@ Run the `ssh macName@macIp` in the linux server at least once . Run the `ssh linux@linuxIp` in the mac server at least once. Install `rsync` and enable sshd in your Linux Server. + +## Author + +Yi Wang a@wyr.me diff --git a/preview.png b/preview.png new file mode 100644 index 0000000..32076c2 Binary files /dev/null and b/preview.png differ diff --git a/src/routes/webhooks.js b/src/routes/webhooks.js index ce56085..7dea74e 100644 --- a/src/routes/webhooks.js +++ b/src/routes/webhooks.js @@ -65,7 +65,7 @@ const gitCodeUpdate = async (buidType) => { } else { resolve({ code: 1, - type: 'clone', + type: 'pull', change: false }) } @@ -75,18 +75,19 @@ const gitCodeUpdate = async (buidType) => { const promiseList = [] - if (buidType.includes('mac')) { - if (!fs.existsSync(sourcePath)) { - mkdirsSync(sourcePath) - promiseList.push(gitClone(repoPath, sourcePath, 'Source')) + // 无论是否包含mac,都应该更新参照代码 + // if (buidType.includes('mac')) { + if (!fs.existsSync(sourcePath)) { + mkdirsSync(sourcePath) + promiseList.push(gitClone(repoPath, sourcePath, 'Source')) + } else { + if (fs.readdirSync(sourcePath).includes('.git')) { + promiseList.push(gitPull(sourcePath, 'Source')) } else { - if (fs.readdirSync(sourcePath).includes('.git')) { - promiseList.push(gitPull(sourcePath, 'Source')) - } else { - promiseList.push(gitClone(repoPath, sourcePath, 'Source')) - } + promiseList.push(gitClone(repoPath, sourcePath, 'Source')) } } + // } if (buidType.includes('linux')) { if (!fs.existsSync(linuxPath)) {