-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support cache computation on windows (#157)
* fix: support cache computation on windows On windows runners, the cache keys fails to be computed because of the `checksum` function that can't find the file in /tmp. Indeed, it seems that bash `/tmp` is not the runner's `C:\tmp` directory. See https://app.circleci.com/pipelines/github/KnodesCommunity/typedoc-plugins/693/workflows/897cb674-230e-46ae-99f5-b10d93f4b723/jobs/3872/parallel-runs/0/steps/0-106 for an example of failed step * Update determine-lockfile.sh * Add quote to variable expansion * remove trailing backslash * ci: add tests for the windows executor Co-authored-by: Eric Ribeiro <[email protected]>
- Loading branch information
1 parent
543c774
commit 589b116
Showing
2 changed files
with
34 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
TARGET_DIR="/tmp" | ||
if [ -n "$HOMEDRIVE" ]; then | ||
TARGET_DIR="$HOMEDRIVE\\tmp" | ||
fi | ||
|
||
# Link corresponding lock file to a temporary file used by cache commands | ||
if [ -f "package-lock.json" ]; then | ||
echo "Found package-lock.json file, assuming lockfile" | ||
cp package-lock.json /tmp/node-project-lockfile | ||
cp package-lock.json $TARGET_DIR/node-project-lockfile | ||
elif [ -f "npm-shrinkwrap.json" ]; then | ||
echo "Found npm-shrinkwrap.json file, assuming lockfile" | ||
cp npm-shrinkwrap.json /tmp/node-project-lockfile | ||
cp npm-shrinkwrap.json $TARGET_DIR/node-project-lockfile | ||
elif [ -f "yarn.lock" ]; then | ||
echo "Found yarn.lock file, assuming lockfile" | ||
cp yarn.lock /tmp/node-project-lockfile | ||
cp yarn.lock $TARGET_DIR/node-project-lockfile | ||
fi | ||
cp package.json /tmp/node-project-package.json | ||
|
||
cp package.json $TARGET_DIR/node-project-package.json |