There was an error while loading. Please reload this page.
2 parents 5bd0e2f + 2e4d166 commit 837c93aCopy full SHA for 837c93a
3 files changed
lib/config.coffee
@@ -4,21 +4,14 @@ pathUtils = require('path')
4
5
configFileName = "config.json"
6
7
-_updateConfig = (config)->
8
- config.server = config.server || "https://rally1.rallydev.com"
9
- config
10
-
11
saveConfig = ({path, config}, callback)->
12
configPath = pathUtils.join(path, configFileName)
13
fs.writeFile(configPath, JSON.stringify(config, null, ' '), callback)
14
15
getConfig = (path, callback) ->
16
convertToJson = (error, file)->
17
if !error
18
- config = JSON.parse(file)
19
- _updateConfig(config)
20
- saveConfig({config, path})
21
- callback(null, config)
+ callback(null, JSON.parse(file))
22
else
23
callback(error)
24
@@ -39,5 +32,5 @@ getAppSourceRoot = (path, callback) ->
39
32
common = pathUtils.resolve common, '..'
40
33
callback null, common
41
34
42
-module.exports = {_updateConfig,getConfig,saveConfig,getAppSourceRoot}
35
+module.exports = {getConfig,saveConfig,getAppSourceRoot}
43
36
_.defaults module.exports, {configFileName}
package.json
@@ -2,7 +2,7 @@
2
"author": "Kyle Morse <morky01@ca.com>",
3
"name": "rally-app-builder",
"description": "A node module that assists in the building of Rally Apps",
- "version": "1.6.1",
+ "version": "1.6.2",
"homepage": "https://github.com/rallyapps/rally-app-builder",
"repository": {
"type": "git",
test/config.test.coffee
@@ -3,30 +3,6 @@ config = require '../lib/config'
path = require 'path'
describe 'Config', ()->
- describe('Updates Config', ()->
- testConfig = {
- "name": "CardboardCustomCard",
- "className": "CustomApp",
- "sdk": "2.0p5",
- "javascript": [
- "CustomCard.js",
- "App.js",
- "TestCoffee.coffee"
- ],
- "css": [
- "app.css"
- "parents": [
- "ferentchak/teamboard",
- "rallyapps/ninjas"
- ]
- }
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
- )
30
31
describe '#getAppSourceRoot', () ->
0 commit comments