Skip to content

Commit

Permalink
add support for .desk file
Browse files Browse the repository at this point in the history
  • Loading branch information
ianberinger committed Feb 10, 2016
1 parent 3c31a79 commit ac74f11
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ There are no dependencies other than `bash`. Desk is explicitly tested with `bas
`zsh`, and `fish`.

```sh
◲ desk 0.3.2
◲ desk 0.4.1

Usage:

Expand All @@ -40,6 +40,7 @@ Usage:
List all desks along with a description.
desk (.|go) <desk-name> [shell-args...]
Activate a desk. Extra arguments are passed onto shell.
Without a name specified, it tries activating the desk specified in the ./DESKFILE file.
desk run <desk-name> <cmd>
Run a command within a desk's environment then exit. Think '$SHELL -c'.
desk edit [desk-name]
Expand Down Expand Up @@ -97,7 +98,7 @@ desk for doing work on a terraform repo
Basically, desk just associates a shell script (`name.sh`) with a name. When
you call `desk . name`, desk drops you into a shell where `name.sh` has been
executed, and then desk extracts out certain comments in `name.sh` for useful
rendering.
rendering. If you call `desk .` without any desk specified, desk will look for a DESKFILE file in the current directory and uses its content as the name.

### Installing

Expand Down
8 changes: 7 additions & 1 deletion desk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ DESKS="${DESK_DESKS_DIR:-$PREFIX/desks}"
## Commands

cmd_version() {
echo "◲ desk 0.4.0"
echo "◲ desk 0.4.1"
}


Expand All @@ -27,6 +27,7 @@ Usage:
List all desks along with a description.
$PROGRAM (.|go) <desk-name> [shell-args...]
Activate a desk. Extra arguments are passed onto shell.
Without a name specified, it tries activating the desk specified in the ./.desk file.
$PROGRAM run <desk-name> <cmd>
Run a command within a desk's environment then exit. Think '\$SHELL -c'.
$PROGRAM edit [desk-name]
Expand Down Expand Up @@ -91,6 +92,11 @@ cmd_init() {

cmd_go() {
local TODESK="$1"
if [ -z "$TODESK" -a -f "${PWD}/DESKFILE" ]; then
# if no desk is specified try the DESKFILE file in the current directory
read TODESK < "${PWD}/DESKFILE"
fi

local DESKEXT=$(get_deskfile_extension)
local DESKPATH="$(find "${DESKS}/" -name "${TODESK}${DESKEXT}")"

Expand Down

0 comments on commit ac74f11

Please sign in to comment.