From 7da308c7d1431224e75f79d872454fc3da24c2c8 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Fri, 7 Apr 2023 21:31:54 +0900 Subject: [PATCH] Revert "rename non-usable artifacts #1551" This reverts commit 194406eed6af3db2dea3372559672a462238f347. --- package.json | 1 - script/afterAllArtifactBuild.js | 27 --------------------------- script/testAfterAllArtifactBuild.js | 11 ----------- 3 files changed, 39 deletions(-) delete mode 100644 script/afterAllArtifactBuild.js delete mode 100644 script/testAfterAllArtifactBuild.js diff --git a/package.json b/package.json index 43f85117..88731f81 100644 --- a/package.json +++ b/package.json @@ -138,7 +138,6 @@ "appId": "no.mifi.losslesscut", "artifactName": "${productName}-${os}-${arch}.${ext}", "afterSign": "electron-builder-notarize", - "afterAllArtifactBuild": "./script/afterAllArtifactBuild.js", "mac": { "hardenedRuntime": true, "appId": "no.mifi.losslesscut-mac", diff --git a/script/afterAllArtifactBuild.js b/script/afterAllArtifactBuild.js deleted file mode 100644 index 70fa4e32..00000000 --- a/script/afterAllArtifactBuild.js +++ /dev/null @@ -1,27 +0,0 @@ -const { join, dirname, basename } = require('path'); -const { rename } = require('fs/promises'); - -module.exports = async (buildResult) => { - const newArtifactPaths = []; - - // eslint-disable-next-line no-restricted-syntax - for (const artifactPath of buildResult.artifactPaths) { - const artifactName = basename(artifactPath); - - // Because many people try to download these files but get confused by it - if (['LosslessCut-win-x64.appx', 'LosslessCut-mac-universal.pkg'].includes(artifactName)) { - const newPath = join(dirname(artifactPath), `${artifactName}-DO-NOT-DOWNLOAD`); - // eslint-disable-next-line no-await-in-loop - await rename(artifactPath, newPath); - newArtifactPaths.push(newPath); - } else { - newArtifactPaths.push(artifactPath); - } - } - - // console.log(newArtifactPaths) - - // this seems to be the only way to do it - // eslint-disable-next-line no-param-reassign - buildResult.artifactPaths = newArtifactPaths; -}; diff --git a/script/testAfterAllArtifactBuild.js b/script/testAfterAllArtifactBuild.js deleted file mode 100644 index d35fa69c..00000000 --- a/script/testAfterAllArtifactBuild.js +++ /dev/null @@ -1,11 +0,0 @@ -const afterAllArtifactBuild = require('./afterAllArtifactBuild'); - -afterAllArtifactBuild({ - outDir: '/path/to/lossless-cut/dist', - artifactPaths: [ - '/path/to/lossless-cut/dist/LosslessCut-mac-arm64.dmg.blockmap', - '/path/to/lossless-cut/dist/LosslessCut-mac-arm64.dmg', - '/path/to/lossless-cut/dist/LosslessCut-mac-universal.pkg', - '/path/to/lossless-cut/dist/LosslessCut-win-x64.appx', - ], -});