Merge pull request #2510 from resin-io/fix-file-selector-constraint-path

Fix incorrect file constraint path
This commit is contained in:
Lorenzo Alberto Maria Ambrosi 2018-10-17 16:42:46 +02:00 committed by GitHub
commit 89fa682721
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -16,6 +16,7 @@
'use strict'
const _ = require('lodash')
const os = require('os')
const settings = require('../../../models/settings')
const utils = require('../../../../../shared/utils')
@ -65,6 +66,7 @@ module.exports = function (
* <file-selector path="FileSelectorController.getPath()"></file-selector>
*/
this.getPath = () => {
return this.getFolderConstraint() ? '/' : os.homedir()
const constraintFolderPath = this.getFolderConstraint()
return _.isEmpty(constraintFolderPath) ? os.homedir() : constraintFolderPath
}
}

View File

@ -36,7 +36,7 @@ describe('Spectron', function () {
before('app:start', function () {
app = new spectron.Application({
path: entrypoint,
port: 9997,
port: 9996,
args: [ '.' ]
})