Skip to content

Commit

Permalink
Merge pull request #131 from tehw0lf/use-gpr-hack
Browse files Browse the repository at this point in the history
Implement gpr hack
  • Loading branch information
tehw0lf authored Dec 15, 2021
2 parents f7f98c5 + b11caa6 commit d66da2e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 43 additions & 0 deletions gpr-hack.js
Original file line number Diff line number Diff line change
@@ -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)
);

0 comments on commit d66da2e

Please sign in to comment.