Add local cargo registry type
- serve sparse index and config.json for local cargo repos from a cargo_index table - add Web API publish, yank and unyank under the local repo api root - drop index lines when the crate file is deleted
This commit is contained in:
@@ -229,6 +229,25 @@ go mod download`,
|
||||
];
|
||||
|
||||
case 'cargo':
|
||||
if (isLocal) {
|
||||
return [
|
||||
{
|
||||
title: 'Add the private registry (real sparse registry)',
|
||||
language: 'toml',
|
||||
code: `# $CARGO_HOME/config.toml
|
||||
[registries.${name}]
|
||||
index = "sparse+${url}/api/v1/local/${name}/"`,
|
||||
note: 'cargo requires a token for publish/yank: set CARGO_REGISTRIES_' + name.toUpperCase().replace(/-/g, '_') + '_TOKEN to any value.',
|
||||
},
|
||||
{
|
||||
title: 'Publish, depend on and yank crates',
|
||||
language: 'bash',
|
||||
code: `cargo publish --registry ${name}
|
||||
cargo add <crate> --registry ${name}
|
||||
cargo yank --version <version> --registry ${name}`,
|
||||
},
|
||||
];
|
||||
}
|
||||
return [
|
||||
{
|
||||
title: 'Point crates.io at this sparse registry',
|
||||
|
||||
Reference in New Issue
Block a user