Skip to content

Commit

Permalink
Merge pull request #6 from dolliejs/hotfix/publish
Browse files Browse the repository at this point in the history
fix: 🐛 publish script and ci configuration
  • Loading branch information
lenconda authored Jul 1, 2021
2 parents 8e51235 + 0c89775 commit 928d0b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ jobs:
- v1-dist-
- v1-dependencies-{{ checksum "checksum.txt" }}
- v1-dependencies-
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
- run: ls -al
- run: npm run publish

Expand Down
10 changes: 9 additions & 1 deletion scripts/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,16 @@ function publish(pkg, directory) {
}

const BASE_PATH = path.join(__dirname, '../packages/@dollie');
const NPM_TOKEN = process.env.NPM_TOKEN;

if (!NPM_TOKEN) {
console.log('No npm token found');
}

const packages = fs.readdirSync(BASE_PATH);

for (const packageName of packages) {
publish(packageName, path.join(BASE_PATH, packageName));
const packagePathname = path.join(BASE_PATH, packageName);
fs.writeFileSync(path.join(packagePathname, '.npmrc'), `//registry.npmjs.org/:_authToken=${NPM_TOKEN}`);
publish(packageName, packagePathname);
}

0 comments on commit 928d0b1

Please sign in to comment.