From 087a438a74e1314c8c321d6f1d893ee1cc6e8df1 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Thu, 7 Jan 2021 17:01:14 +0100 Subject: [PATCH] fix --- .github/workflows/build-app.yaml | 3 +-- generatePadFile.js | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-app.yaml b/.github/workflows/build-app.yaml index 77eb4f47a..8e4226faa 100644 --- a/.github/workflows/build-app.yaml +++ b/.github/workflows/build-app.yaml @@ -59,8 +59,6 @@ jobs: mv app/dist/*.deb artifacts/ || true mv app/dist/*.dmg artifacts/ || true - mv app/dist/dbgate-pad.xml artifacts/ || true - # - name: Copy artifacts Linux, MacOs # if: matrix.os != 'windows-2016' # run: | @@ -89,6 +87,7 @@ jobs: if: matrix.os == 'windows-2016' run: | mv app/dist/latest.yml artifacts/latest.yml || true + mv app/dist/dbgate-pad.xml artifacts/ || true - name: Copy latest-linux.yml if: matrix.os == 'ubuntu-18.04' diff --git a/generatePadFile.js b/generatePadFile.js index 53960b1c6..7e6655227 100644 --- a/generatePadFile.js +++ b/generatePadFile.js @@ -12,7 +12,7 @@ let size = 0; const files = fs.readdirSync('app/dist'); for (const file of files) { if (file.endsWith('.exe')) { - const stats = fs.statSync(path.join('app', 'dist', 'file')); + const stats = fs.statSync(path.join('app', 'dist', file)); size = stats.size; } } @@ -26,4 +26,6 @@ const padContent = template .replace('#SIZE_KB#', Math.round(size / 1024)) .replace('#SIZE_MB#', Math.round(size / 1024 / 1024)); -fs.writeFileSync('app/dist/dbgate-pad.xml', padContent, 'utf-8'); +if (size > 0) { + fs.writeFileSync('app/dist/dbgate-pad.xml', padContent, 'utf-8'); +}