diff --git a/README.md b/README.md index f86ec17..74d3ab0 100644 --- a/README.md +++ b/README.md @@ -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: @@ -40,6 +40,7 @@ Usage: List all desks along with a description. desk (.|go) [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 Run a command within a desk's environment then exit. Think '$SHELL -c'. desk edit [desk-name] @@ -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 diff --git a/desk b/desk index 781612d..fa963a4 100755 --- a/desk +++ b/desk @@ -8,7 +8,7 @@ DESKS="${DESK_DESKS_DIR:-$PREFIX/desks}" ## Commands cmd_version() { - echo "◲ desk 0.4.0" + echo "◲ desk 0.4.1" } @@ -27,6 +27,7 @@ Usage: List all desks along with a description. $PROGRAM (.|go) [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 Run a command within a desk's environment then exit. Think '\$SHELL -c'. $PROGRAM edit [desk-name] @@ -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}")"