Skip to content

Commit

Permalink
Impl. projectDir variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcisiojr committed Nov 8, 2014
1 parent cb84314 commit 5dae614
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,32 @@ Following is a description of each attribute:

**label:** Label that show in menus and quick search.

**cmd:** Command that will be executed. You can use $0, $1, ... $n to specify custom arguments, that will be propted for user.
**cmd:** Command that will be executed. You can use $0, $1, ... $n to specify custom arguments, that will be prompted for user.

**args:** Array that contains default arguments, in case user supply anything.

**key:** Hotkey that will perform a quick access to command.

**splitChar:** Specify the char that will separate arguments of command. Default value is ':'.

**opts:** Optional attributes that configure some options of execution enviroment.
**opts:** Optional attributes that configure some options of execution environment.

**opts.defaultPath:** Directory path where command will executed.

**opts.hiddenConsole:** True indicates that output panel will not open after command execution.

**opts.killCmd:** Command that will be triggered by 'Kill Commands' menu option.



System Parameters: Reserved variables that can be used to compose commands.

**$selectedFile** Path to selected file.

**$dirOfSelectedFile** Path to directory of selected file.

**$projectDir** Path directory of project.

Screenshots
-----------

Expand Down
2 changes: 1 addition & 1 deletion cmdrunner.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"key" : "Ctrl-Alt-Shift-S"
},{
"label": "Curl ",
"cmd": "curl $0 $1",
"cmd": "curl '$projectDir'",
"args" : [],
"splitChar": "|",
"key" : ""
Expand Down
6 changes: 6 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ define(function (require, exports, module) {
var doc = DocumentManager.getCurrentDocument();

return !doc ? opts.defaultPath : doc.file.parentPath;
},

projectDir: function(opts) {
var dir = ProjectManager.getProjectRoot();

return dir ? dir.fullPath : '.';
}
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"title": "Command Runner",
"description": "Add hotkeys for running command line tools.",
"homepage": "https://github.com/tarcisiojr/brackets-command-runner",
"version": "0.0.15",
"version": "0.0.16",
"author": "Tarcísio Abadio de Magalhães Júnior <[email protected]>",
"license": "MIT",
"engines": {
Expand Down

0 comments on commit 5dae614

Please sign in to comment.