eslint-config-un 1.0.0-alpha.41 → 1.0.0-alpha.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +6 -3
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -37,14 +37,17 @@ const computeCacheKey = async (context) => {
|
|
|
37
37
|
const packageJsonPath = packageUtils.up();
|
|
38
38
|
const lockfilePaths = (packageManagerInfo ? LOCKFILES_PER_PACKAGE_MANAGER[packageManagerInfo.name].map(([lockfileName]) => lockfileName) : []).map((lockfileName) => findUp.file(lockfileName));
|
|
39
39
|
const eslintConfigPaths = ESLINT_FLAT_CONFIG_FILE_NAMES.map((eslintConfigFileName) => findUp.file(eslintConfigFileName));
|
|
40
|
-
const [
|
|
41
|
-
exec("git rev-parse HEAD"),
|
|
40
|
+
const [gitHeadHashResult, ...filesToHash] = await Promise.all([
|
|
41
|
+
exec("git", ["rev-parse", "HEAD"]).then((v) => v, (error) => {
|
|
42
|
+
context.logger.warn("Error getting git HEAD hash:", error);
|
|
43
|
+
return null;
|
|
44
|
+
}),
|
|
42
45
|
gitignorePath && readFileSafe(gitignorePath, true),
|
|
43
46
|
packageJsonPath && readFileSafe(packageJsonPath, true),
|
|
44
47
|
Promise.all(lockfilePaths.map((lockfilePath) => lockfilePath ? readFileSafe(lockfilePath, true) : null)).then((files) => files.find((v) => v != null)),
|
|
45
48
|
Promise.all(eslintConfigPaths.map((eslintConfigPath) => eslintConfigPath ? readFileSafe(eslintConfigPath, true) : null)).then((files) => files.find((v) => v != null))
|
|
46
49
|
]);
|
|
47
|
-
result.push(
|
|
50
|
+
result.push(gitHeadHashResult ? gitHeadHashResult.exitCode ? String(gitHeadHashResult.exitCode) : gitHeadHashResult.stdout : "", ...filesToHash.map((file) => file ? sha256(file) : ""));
|
|
48
51
|
return {
|
|
49
52
|
source: result,
|
|
50
53
|
hash: sha256(JSON.stringify(result))
|