@yarnpkg/fslib
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -60,7 +60,5 @@ "use strict"; | ||
break; | ||
default: | ||
{ | ||
throw new Error(`Unsupported file type (${sourceStat.mode})`); | ||
} | ||
break; | ||
default: { | ||
throw new Error(`Unsupported file type (${sourceStat.mode})`); | ||
} | ||
} | ||
@@ -134,3 +132,7 @@ // We aren't allowed to modify the destination if we work with the index, | ||
const sourceHash = await sourceFs.checksumFilePromise(source, { algorithm: `sha1` }); | ||
const indexPath = destinationFs.pathUtils.join(linkStrategy.indexPath, sourceHash.slice(0, 2), `${sourceHash}.dat`); | ||
const defaultMode = 0o644; | ||
const sourceMode = sourceStat.mode & 0o777; | ||
// add mode to the index file name if it's not the default b/c different packages could have the file with same content, but different modes | ||
const indexFileName = `${sourceHash}${sourceMode !== defaultMode ? sourceMode.toString(8) : ``}`; | ||
const indexPath = destinationFs.pathUtils.join(linkStrategy.indexPath, sourceHash.slice(0, 2), `${indexFileName}.dat`); | ||
let AtomicBehavior; | ||
@@ -217,4 +219,8 @@ (function (AtomicBehavior) { | ||
postlayout.push(async () => { | ||
if (!indexStat) | ||
if (!indexStat) { | ||
await destinationFs.lutimesPromise(indexPath, defaultTime, defaultTime); | ||
if (sourceMode !== defaultMode) { | ||
await destinationFs.chmodPromise(indexPath, sourceMode); | ||
} | ||
} | ||
if (tempPath && !tempPathCleaned) { | ||
@@ -221,0 +227,0 @@ await destinationFs.unlinkPromise(tempPath); |
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import { URL } from 'url'; | ||
import { FakeFS } from './FakeFS'; | ||
@@ -5,0 +3,0 @@ import { ProxiedFS } from './ProxiedFS'; |
@@ -30,3 +30,3 @@ "use strict"; | ||
return path; | ||
if (path instanceof url_1.URL) | ||
if (path instanceof URL) | ||
return (0, url_1.fileURLToPath)(path); | ||
@@ -33,0 +33,0 @@ if (Buffer.isBuffer(path)) { |
{ | ||
"name": "@yarnpkg/fslib", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"license": "BSD-2-Clause", | ||
@@ -15,3 +15,3 @@ "main": "./lib/index.js", | ||
"devDependencies": { | ||
"@yarnpkg/libzip": "^3.0.0" | ||
"@yarnpkg/libzip": "^3.0.1" | ||
}, | ||
@@ -18,0 +18,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
230799
5973