Skip to content

Commit 837c93a

Browse files
authored
Merge pull request #76 from RallyApps/stop_saving_config
Stop trying to resave the config file all the time
2 parents 5bd0e2f + 2e4d166 commit 837c93a

3 files changed

Lines changed: 3 additions & 34 deletions

File tree

lib/config.coffee

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,14 @@ pathUtils = require('path')
44

55
configFileName = "config.json"
66

7-
_updateConfig = (config)->
8-
config.server = config.server || "https://rally1.rallydev.com"
9-
config
10-
117
saveConfig = ({path, config}, callback)->
128
configPath = pathUtils.join(path, configFileName)
139
fs.writeFile(configPath, JSON.stringify(config, null, ' '), callback)
1410

1511
getConfig = (path, callback) ->
1612
convertToJson = (error, file)->
1713
if !error
18-
config = JSON.parse(file)
19-
_updateConfig(config)
20-
saveConfig({config, path})
21-
callback(null, config)
14+
callback(null, JSON.parse(file))
2215
else
2316
callback(error)
2417

@@ -39,5 +32,5 @@ getAppSourceRoot = (path, callback) ->
3932
common = pathUtils.resolve common, '..'
4033
callback null, common
4134

42-
module.exports = {_updateConfig,getConfig,saveConfig,getAppSourceRoot}
35+
module.exports = {getConfig,saveConfig,getAppSourceRoot}
4336
_.defaults module.exports, {configFileName}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"author": "Kyle Morse <morky01@ca.com>",
33
"name": "rally-app-builder",
44
"description": "A node module that assists in the building of Rally Apps",
5-
"version": "1.6.1",
5+
"version": "1.6.2",
66
"homepage": "https://github.com/rallyapps/rally-app-builder",
77
"repository": {
88
"type": "git",

test/config.test.coffee

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,6 @@ config = require '../lib/config'
33
path = require 'path'
44

55
describe 'Config', ()->
6-
describe('Updates Config', ()->
7-
testConfig = {
8-
"name": "CardboardCustomCard",
9-
"className": "CustomApp",
10-
"sdk": "2.0p5",
11-
"javascript": [
12-
"CustomCard.js",
13-
"App.js",
14-
"TestCoffee.coffee"
15-
],
16-
"css": [
17-
"app.css"
18-
],
19-
"parents": [
20-
"ferentchak/teamboard",
21-
"rallyapps/ninjas"
22-
]
23-
}
24-
25-
updatedConfig = config._updateConfig(testConfig)
26-
it "should add a server to the config file if one is not present",
27-
()->
28-
assert(updatedConfig.server == "https://rally1.rallydev.com")
29-
)
306

317
describe '#getAppSourceRoot', () ->
328

0 commit comments

Comments
 (0)