fix(ci): fix backslash-bang syntax error in workflow
This commit is contained in:
parent
f260b59075
commit
b7d409e762
1 changed files with 2 additions and 2 deletions
|
|
@ -37,14 +37,14 @@ jobs:
|
|||
PKG_VERSION=$(node -p "require(\"./package.json\").version")
|
||||
SHOULD_PUBLISH=$(node -p "require(\"./package.json\")?._?.publish === true")
|
||||
REGISTRY=$(node -p "require(\"./package.json\")?._?.registry || \"none\"")
|
||||
if [ "$REGISTRY" \!= "forgejo" ] || [ "$SHOULD_PUBLISH" \!= "true" ]; then
|
||||
if [ "$REGISTRY" != "forgejo" ] || [ "$SHOULD_PUBLISH" != "true" ]; then
|
||||
echo "Skipping publish"
|
||||
exit 0
|
||||
fi
|
||||
if npm view "$PKG_NAME@$PKG_VERSION" version 2>/dev/null; then
|
||||
echo "Already published: $PKG_NAME@$PKG_VERSION"
|
||||
else
|
||||
node -e "const fs=require(\"fs\");const p=JSON.parse(fs.readFileSync(\"package.json\"));const t=d=>{if(\!d)return d;for(const[n,v]of Object.entries(d)){if(v.startsWith(\"workspace:\")||v.startsWith(\"file:\"))d[n]=\"*\";}return d;};p.dependencies=t(p.dependencies);p.devDependencies=t(p.devDependencies);fs.writeFileSync(\"package.json\",JSON.stringify(p,null,2));"
|
||||
node -e "const fs=require(\"fs\");const p=JSON.parse(fs.readFileSync(\"package.json\"));const t=d=>{if(!d)return d;for(const[n,v]of Object.entries(d)){if(v.startsWith(\"workspace:\")||v.startsWith(\"file:\"))d[n]=\"*\";}return d;};p.dependencies=t(p.dependencies);p.devDependencies=t(p.devDependencies);fs.writeFileSync(\"package.json\",JSON.stringify(p,null,2));"
|
||||
npm publish --access public --no-git-checks
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue