cargo-cp-artifact
Advanced tools
Comparing version 0.1.8 to 0.1.9
{ | ||
"name": "cargo-cp-artifact", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "Copies compiler artifacts emitted by rustc by parsing Cargo metadata", | ||
@@ -32,4 +32,4 @@ "main": "src/index.js", | ||
"devDependencies": { | ||
"mocha": "^10.0.0" | ||
"mocha": "^10.2.0" | ||
} | ||
} |
@@ -82,3 +82,3 @@ # cargo-cp-artifact | ||
It surprisingly difficult to reliably find the location of a cargo compiler artifact. It is impacted by many parameters, including: | ||
It's surprisingly difficult to reliably find the location of a cargo compiler artifact. It is impacted by many parameters, including: | ||
@@ -85,0 +85,0 @@ * Build profile |
@@ -9,3 +9,3 @@ "use strict"; | ||
[ | ||
"cargo-cp-artifct -a cdylib my-crate index.node", | ||
"cargo-cp-artifact -a cdylib my-crate index.node", | ||
"--", | ||
@@ -12,0 +12,0 @@ "cargo build --message-format=json-render-diagnostics", |
@@ -83,4 +83,4 @@ "use strict"; | ||
const filename = filenames[i]; | ||
const key = getArtifactName({ artifactType: kind, crateName: name }); | ||
const outputFiles = options.artifacts[key]; | ||
const { key, outputFiles } = | ||
getOutputFiles(kind, name, options.artifacts) || {}; | ||
@@ -104,2 +104,20 @@ if (!outputFiles || !filename) { | ||
function getOutputFiles(kind, name, artifacts) { | ||
const key = getArtifactName({ artifactType: kind, crateName: name }); | ||
const outputFiles = artifacts[key]; | ||
if (outputFiles) { | ||
return { key, outputFiles }; | ||
} | ||
// Cargo started replacing `-` with `_` in artifact names. Reverse the process | ||
// and check again. https://github.com/rust-lang/cargo/issues/13867 | ||
const altKey = key.replace(/_/g, "-"); | ||
return { | ||
key: altKey, | ||
outputFiles: artifacts[altKey], | ||
}; | ||
} | ||
async function isNewer(filename, outputFile) { | ||
@@ -106,0 +124,0 @@ try { |
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
12292
255