include tag into basename. to be ready to urls whitelisting

This commit is contained in:
igorklopov 2016-09-10 17:24:42 +04:00
parent ea78f87b33
commit 0e68f3afb3
2 changed files with 8 additions and 5 deletions

View File

@ -13,14 +13,17 @@ function tagFromVersion (version) {
export function localPlace (opts) {
const p = placesJson.localPlace;
const atHome = p.replace('~', os.homedir());
const { version } = opts;
Object.assign(opts, { tag: tagFromVersion(version) });
const tag = tagFromVersion(version);
Object.assign(opts, { tag });
const atHome = p.replace('~', os.homedir());
return expand(path.resolve(atHome), opts);
}
export function remotePlace (opts) {
const p = placesJson.remotePlace;
return { tag: tagFromVersion(opts.version),
name: expand(p, opts) };
const { version } = opts;
const tag = tagFromVersion(version);
Object.assign(opts, { tag });
return { tag, name: expand(p, opts) };
}

View File

@ -1,4 +1,4 @@
{
"localPlace": "~/.pkg-cache/{tag}/{from}-{nodeVersion}-{platform}-{arch}",
"remotePlace": "uploaded-{nodeVersion}-{platform}-{arch}"
"remotePlace": "uploaded-{tag}-node-{nodeVersion}-{platform}-{arch}"
}