mirror of
https://github.com/ershisan99/go-npm.git
synced 2025-12-16 12:33:24 +00:00
UPDATE getUrl with actual mappings
This commit is contained in:
@@ -60,7 +60,7 @@ describe('common', () => {
|
|||||||
const url = common.getUrl({
|
const url = common.getUrl({
|
||||||
default: 'http://url.tar.gz',
|
default: 'http://url.tar.gz',
|
||||||
windows: 'http://url.exe.zip'
|
windows: 'http://url.exe.zip'
|
||||||
}, { platform: 'windows' });
|
}, { platform: 'win32' });
|
||||||
|
|
||||||
expect(url).toEqual('http://url.exe.zip');
|
expect(url).toEqual('http://url.exe.zip');
|
||||||
});
|
});
|
||||||
@@ -82,7 +82,7 @@ describe('common', () => {
|
|||||||
default: 'http://url_darwin.tar.gz',
|
default: 'http://url_darwin.tar.gz',
|
||||||
386: 'http://url_darwin_i386.tar.gz'
|
386: 'http://url_darwin_i386.tar.gz'
|
||||||
}
|
}
|
||||||
}, { platform: 'darwin', arch: '386' });
|
}, { platform: 'darwin', arch: 'ia32' });
|
||||||
|
|
||||||
expect(url).toEqual('http://url_darwin_i386.tar.gz');
|
expect(url).toEqual('http://url_darwin_i386.tar.gz');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
"request": "^2.81.0",
|
"request": "^2.81.0",
|
||||||
"tar": "^2.2.1"
|
"tar": "^2.2.2"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -23,8 +23,8 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/sanathkr/go-npm",
|
"homepage": "https://github.com/sanathkr/go-npm",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-cli": "^6.24.1",
|
"babel-cli": "^6.26.0",
|
||||||
"babel-core": "^6.25.0",
|
"babel-core": "^6.26.0",
|
||||||
"babel-preset-es2015": "^6.24.1",
|
"babel-preset-es2015": "^6.24.1",
|
||||||
"jest": "^24.5.0"
|
"jest": "^24.5.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,8 +78,8 @@ function getUrl(url, process) {
|
|||||||
|
|
||||||
let _url;
|
let _url;
|
||||||
|
|
||||||
if (url[process.platform]) {
|
if (url[PLATFORM_MAPPING[process.platform]]) {
|
||||||
_url = url[process.platform];
|
_url = url[PLATFORM_MAPPING[process.platform]];
|
||||||
} else {
|
} else {
|
||||||
_url = url.default;
|
_url = url.default;
|
||||||
}
|
}
|
||||||
@@ -88,8 +88,8 @@ function getUrl(url, process) {
|
|||||||
return _url;
|
return _url;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_url[process.arch]) {
|
if (_url[ARCH_MAPPING[process.arch]]) {
|
||||||
_url = _url[process.arch]
|
_url = _url[ARCH_MAPPING[process.arch]]
|
||||||
} else {
|
} else {
|
||||||
_url = _url.default;
|
_url = _url.default;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user