Skip to content

Commit

Permalink
🐛 fix: fix publish.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
aiyoudiao committed Aug 25, 2024
1 parent e0dba44 commit c39e4df
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions publish.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
# 确保脚本具有执行权限
chmod +x "$0"

# 登录 npm
npm login

# 指定要发布的项目名称列表
projects=("i18n-en" "i18n-zh" "project3")
projects=("i18n-en" "i18n-zh")

# 获取当前脚本所在目录
SCRIPT_DIR=$(cd $(dirname $0); pwd)
Expand All @@ -16,8 +19,10 @@ for project in "${projects[@]}"; do

# 检查 package.json 文件是否存在
if [ -f "$PACKAGE_JSON" ]; then
echo "Publishing $project..."
echo "Fixing package.json for $project..."
cd "$PROJECT_DIR" || exit
npm pkg fix
echo "Publishing $project..."
npm publish --access public
cd "$SCRIPT_DIR" || exit
echo "$project published successfully."
Expand Down

0 comments on commit c39e4df

Please sign in to comment.