Skip to content

Commit

Permalink
only check for tilda at the beginning of the path
Browse files Browse the repository at this point in the history
  • Loading branch information
rarmatei committed Jan 9, 2025
1 parent 0deb1e6 commit 8c358b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion workflow-steps/cache/hashing-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function hash(input: string) {
}

function tildePathToRelative(cachedFolderPath: string) {
if (cachedFolderPath.includes('~')) {
if (cachedFolderPath.startsWith('~')) {
const expandedPath = cachedFolderPath.replace(/^~/, os.homedir());
return path.relative(process.cwd(), expandedPath);
}
Expand Down
2 changes: 1 addition & 1 deletion workflow-steps/cache/output/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -5978,7 +5978,7 @@ function hash(input) {
return crypto.createHash("sha256").update(input).digest("hex");
}
function tildePathToRelative(cachedFolderPath) {
if (cachedFolderPath.includes("~")) {
if (cachedFolderPath.startsWith("~")) {
const expandedPath = cachedFolderPath.replace(/^~/, os.homedir());
return path.relative(process.cwd(), expandedPath);
}
Expand Down

0 comments on commit 8c358b2

Please sign in to comment.