-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(tests): setup package manager consistently for example/integrat…
…ion tests (#6681)
- Loading branch information
Showing
3 changed files
with
29 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
dir=$1 | ||
pkgManager=$2 | ||
|
||
# Update package manager if one was provided | ||
if [ "$pkgManager" != "" ]; then | ||
# Use jq to write a new file with a .packageManager field set and then | ||
# Overwrite original package.json. For some reason the command above won't send its output | ||
# directly to the original file. | ||
jq --arg pm "$pkgManager" '.packageManager = $pm' "$dir/package.json" > "$dir/package.json.new" | ||
mv "$dir/package.json.new" "$dir/package.json" | ||
|
||
# We just created a new file. On Windows, we need to convert it to Unix line endings | ||
# so the hashes will be stable with what's expected in our test cases. | ||
if [[ "$OSTYPE" == "msys" ]]; then | ||
dos2unix --quiet "$dir/package.json" | ||
fi | ||
|
||
git commit -am "Updated package manager to $pkgManager" --quiet | ||
fi |