Skip to content

Commit d7e341e

Browse files
committed
Fixed publish scripts
1 parent 1797f8f commit d7e341e

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"scripts": {
55
"dev": "yarn workspace @corelle/demo-app run dev",
66
"build": "yarn workspaces foreach -A -p run build",
7-
"publish": "./publish.sh"
7+
"publish": "scripts/publish"
88
},
99
"author": "Daven Quinn",
1010
"workspaces": [
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash -e
22

3-
## Ensure work tree is clean
3+
# Ensure work tree is clean
44
if ! git diff --quiet; then
55
echo "Working tree is not clean. Please commit all changes before publishing."
66
exit 1
@@ -19,8 +19,4 @@ read -p "Are you sure you want to publish? (y/n) " -n 1 -r
1919

2020
yarn workspaces foreach --no-private -A npm publish --access public
2121

22-
# Tag the release(s)
23-
yarn workspaces foreach --no-private -A exec -- \
24-
node -p 'const pkg = require("./package.json"); pkg.name + "-v" + pkg.version' \
25-
| xargs git tag || true
26-
22+
yarn workspaces foreach --no-private -A exec -- $(pwd)/scripts/tag-release

frontend/scripts/tag-release

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
version=$(node -p "require('./package.json').version")
4+
name=$(node -p "require('./package.json').name")
5+
6+
tag=$name-v$version
7+
8+
git tag -a "$name-v$version" -m "npm package $name version $version"
9+
if [ $? -eq 0 ]; then
10+
echo "Tagged $tag"
11+
else
12+
echo "Tag $tag already exists"
13+
exit 0
14+
fi

0 commit comments

Comments
 (0)