Skip to content

Commit 967adb9

Browse files
committed
Add setting for Ember project sub-path
Closes lamabiker#5
1 parent bd7f762 commit 967adb9

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

lib/ember-cli-helper-view.coffee

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class EmberCliHelperView extends View
8787
command = atom.config.get('ember-cli-helper.pathToEmberExecutable')
8888
args = [task]
8989
options =
90-
cwd: atom.project.getPaths()[0] + '/'
90+
cwd: atom.project.getPaths()[0] + atom.config.get('ember-cli-helper.emberProjectPath')
9191
stdout = (out)=> @addLine out
9292
stderr = (out)=> @addLine out.fontcolor('red')
9393
exit = (code)=>
@@ -126,7 +126,7 @@ class EmberCliHelperView extends View
126126
args = ['generate', query, "type:object"]
127127
args.push "coffee:true" if atom.config.get 'ember-cli-helper.generateCoffeescript'
128128
options =
129-
cwd: atom.project.getPaths()[0]
129+
cwd: atom.project.getPaths()[0] + atom.config.get('ember-cli-helper.emberProjectPath')
130130
stdout = (out)=> @addLine out.fontcolor("orange")
131131
exit = (code)-> atom.beep() unless code == 0
132132
try

lib/ember-cli-helper.coffee

+23
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,40 @@ module.exports =
55

66
config:
77
generateCoffeescript:
8+
title: 'Generate CoffeeScript'
9+
description: 'Enable to generate CoffeeScript files instead of JavaScript'
810
type: 'boolean'
911
default: false
1012

1113
pathToNodeExecutable:
14+
title: 'Path to Node Executable'
15+
description: """
16+
For the package to work correctly, you need to specify the path to node
17+
on your computer
18+
"""
1219
type: 'string'
1320
default: '/usr/local/bin/node'
1421

1522
pathToEmberExecutable:
23+
title: 'Path to Ember Executable'
24+
description: """
25+
For the package to work correctly, you need to specify the path to the
26+
global ember executable on your computer
27+
"""
1628
type: 'string'
1729
default: '/usr/local/bin/ember'
1830

31+
emberProjectPath:
32+
title: 'Ember Project Path'
33+
description: """
34+
Change only if your Ember project is not in the root of your project,
35+
i.e. if the Ember project is a subdirectory of the directory that's
36+
currently open in Atom. Particularly useful with project-manager, where
37+
you can change settings on a per-project basis.
38+
"""
39+
type: 'string'
40+
default: '/'
41+
1942

2043
activate: (state = {}) ->
2144
@emberCliHelperView = new EmberCliHelperView(state.emberCliHelperViewState)

0 commit comments

Comments
 (0)