Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for .desk file #53

Merged
merged 1 commit into from
Feb 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of date .desk reference

$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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment over-indented

read TODESK < "${PWD}/Deskfile"
fi

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

Expand Down