diff --git a/.github/workflows/build-projects.yml b/.github/workflows/build-projects.yml index dd10f4f2..7df75532 100644 --- a/.github/workflows/build-projects.yml +++ b/.github/workflows/build-projects.yml @@ -35,6 +35,8 @@ jobs: run: npm install -g pnpm - name: Enable pre and post scripts run: pnpm config set enable-pre-post-scripts true + - name: Run GPR hack to set package name to / instead of %2f + run: node gpr-hack.js - name: Install packages run: pnpm install --frozen-lockfile - name: Lint diff --git a/gpr-hack.js b/gpr-hack.js new file mode 100644 index 00000000..900b5bc8 --- /dev/null +++ b/gpr-hack.js @@ -0,0 +1,43 @@ +// gpr-hack.js +const fs = require('fs'); + +contactFormFilePath = 'libs/contact-form/package.json'; +gitPortfolioFilePath = 'libs/git-portfolio/package.json'; +wordlistGeneratorFilePath = 'libs/wordlist-generator/package.json'; + +contactFormName = '@tehw0lf/contact-form'; +gitPortfolioName = '@tehw0lf/git-portfolio'; +wordlistGeneratorName = '@tehw0lf/wordlist-generator'; + +const contactFormFile = fs.readFileSync(contactFormFilePath, { + encoding: 'utf-8' +}); +const contactFormJson = JSON.parse(contactFormFile); +contactFormJson.name = contactFormName; + +const gitPortfolioFile = fs.readFileSync(gitPortfolioFilePath, { + encoding: 'utf-8' +}); +const gitPortfolioJson = JSON.parse(gitPortfolioFile); +gitPortfolioJson.name = gitPortfolioName; + +const wordlistGeneratorFile = fs.readFileSync(wordlistGeneratorFilePath, { + encoding: 'utf-8' +}); +const wordlistGeneratorJson = JSON.parse(wordlistGeneratorFile); +wordlistGeneratorJson.name = wordlistGeneratorName; + +fs.writeFileSync( + contactFormFilePath, + JSON.stringify(contactFormJson, undefined, 2) +); + +fs.writeFileSync( + gitPortfolioFilePath, + JSON.stringify(gitPortfolioJson, undefined, 2) +); + +fs.writeFileSync( + wordlistGeneratorFilePath, + JSON.stringify(wordlistGeneratorJson, undefined, 2) +);