Skip to content

Commit

Permalink
feat: only format when package.json exists
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Dec 30, 2024
1 parent b2edecf commit 1ed40ef
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions scripts/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,17 @@ function create_workspace {
}

function format {
header "FORMATTING"
local -r repo_path=$1
(
cd "$repo_path"
npm ci --legacy-peer-deps
npx prettier --write "*.md" .github
)
header "FORMATTING"
local -r repo_path=$1
if [ ! -f "$repo_path/package.json" ]; then
echo "Skipping formatting as package.json does not exist in $repo_path"
return
fi
(
cd "$repo_path"
npm ci --legacy-peer-deps
npx prettier --write "*.md" .github
)
}

function install_dependencies_on_ci {
Expand Down

0 comments on commit 1ed40ef

Please sign in to comment.