Skip to content

Commit 0afb832

Browse files
committed
Initial commit
0 parents  commit 0afb832

6 files changed

+84
-0
lines changed

Diff for: .gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.DS_Store
2+
npm-debug.log
3+
node_modules

Diff for: LICENSE.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2015 Adam Hull
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Diff for: README.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Atom aliasCommand
2+
3+
A 'lil utility to register existing commands with new names.
4+
Useful if you're conditioned to look for a different name, like `Package Control: Install`.
5+
6+
## Getting Started
7+
8+
```sh
9+
> npm install -g atom-alias-command
10+
```
11+
12+
From you init.coffee (You can open this via `Application: Open Your Init Script`):
13+
```coffee
14+
aliasCommand = require 'atom-alias-command'
15+
16+
aliasCommand 'tree-view:move',
17+
orig: 'tree-view:rename'
18+
19+
aliasCommand 'package-control:install',
20+
orig: 'settings-view:install-packages-and-themes'
21+
22+
# Takes an optional scope for commands that should only
23+
# appear when a particular element has focus
24+
aliasCommand 'grammar-selector:set-syntax',
25+
orig: 'grammar-selector:show'
26+
scope: 'atom-editor'
27+
```
28+
29+
## Running Tests
30+
```sh
31+
> apm test
32+
```

Diff for: lib/atom-alias-command.coffee

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = aliasCommand = (as, {orig, scope}) ->
2+
scope ?= 'atom-workspace'
3+
atom.commands.add scope, as, (event) ->
4+
atom.commands.dispatch event.target, old

Diff for: package.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "atom-alias-command",
3+
"main": "./lib/atom-alias-command",
4+
"version": "0.0.0",
5+
"description": "A short description of your package",
6+
"keywords": [
7+
"alias", "command"
8+
],
9+
"activationCommands": {
10+
"atom-workspace": "atom-alias-command:toggle"
11+
},
12+
"repository": "https://github.com/hurrymaplelad/atom-alias-command",
13+
"license": "MIT",
14+
"engines": {
15+
"atom": ">=1.0.0 <2.0.0"
16+
},
17+
"dependencies": {
18+
}
19+
}

Diff for: spec/atom-alias-command-spec.coffee

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
aliasCommand = require '../lib/atom-alias-command'
2+
3+
describe "aliasCommand", ->
4+
it "doesn't explode", ->
5+
aliasCommand 'new:action',
6+
orig: 'boring:old-action'

0 commit comments

Comments
 (0)