git: Auto replace spaces with underscores in version output. Allows versions to have spaces in their name while keeping it unix friendly folder and file name.
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded
This commit is contained in:
parent
79f3203f70
commit
5d39f776e1
3 changed files with 21 additions and 2 deletions
|
@ -29,7 +29,7 @@ export default class GitProvider {
|
|||
if (this.config.git_required_prefix && !asset.name.startsWith(this.config.git_required_prefix)) continue
|
||||
|
||||
return {
|
||||
version: item.name,
|
||||
version: item.name.replace(/ /g, '_'),
|
||||
link: asset.browser_download_url,
|
||||
filename: asset.name,
|
||||
description: item.body,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "service-core",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.1",
|
||||
"description": "Core boiler plate code to install node server as windows service",
|
||||
"main": "index.mjs",
|
||||
"scripts": {
|
||||
|
|
|
@ -20,6 +20,25 @@ t.describe('#getLatestVersion()', function() {
|
|||
assert.strictEqual(version.log, '')
|
||||
})
|
||||
|
||||
t.test('should auto replace spaces with underscores result', async function() {
|
||||
const assertOriginalName = 'The Smell Of Sea'
|
||||
const assertCorrectName = 'The_Smell_Of_Sea'
|
||||
const assertLink = 'Over The Future'
|
||||
const assertFilename = 'test-sc.7z'
|
||||
let stubber = stub()
|
||||
let provider = new GitProvider({}, stubber)
|
||||
|
||||
stubber.resolves({ body: [
|
||||
{ name: assertOriginalName, assets: [{ name: assertFilename, browser_download_url: assertLink }] },
|
||||
]})
|
||||
|
||||
let version = await provider.getLatestVersion()
|
||||
assert.strictEqual(version.version, assertCorrectName)
|
||||
assert.strictEqual(version.link, assertLink)
|
||||
assert.strictEqual(version.filename, assertFilename)
|
||||
assert.strictEqual(version.log, '')
|
||||
})
|
||||
|
||||
t.test('should skip zip files for now', async function() {
|
||||
const assertName = 'Karen'
|
||||
const assertLink = 'My Wings'
|
||||
|
|
Loading…
Reference in a new issue