Skip to content

Commit

Permalink
Remove last use of LS_PROGRAM
Browse files Browse the repository at this point in the history
Globs are not determined by an `eval` of `ls` anymore. The only other
use of `ls` can be replaced with a simple `printf`.
  • Loading branch information
TheLocehiliosan committed Sep 16, 2017
1 parent b78bb1e commit f23bdb8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 78 deletions.
66 changes: 0 additions & 66 deletions test/003_unit_ls_program.bats

This file was deleted.

13 changes: 1 addition & 12 deletions yadm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ FULL_COMMAND=""

GPG_PROGRAM="gpg"
GIT_PROGRAM="git"
LS_PROGRAM="/bin/ls"
ENVTPL_PROGRAM="envtpl"
LSB_RELEASE_PROGRAM="lsb_release"

Expand Down Expand Up @@ -437,7 +436,6 @@ function encrypt() {

require_gpg
require_encrypt
require_ls

#; process relative to YADM_WORK
YADM_WORK=$(unix_path "$("$GIT_PROGRAM" config core.worktree)")
Expand Down Expand Up @@ -473,7 +471,7 @@ function encrypt() {

#; report which files will be encrypted
echo "Encrypting the following files:"
"$LS_PROGRAM" -1 -d "${ENC_FILES[@]}"
printf '%s\n' "${ENC_FILES[@]}"
echo

#; encrypt all files which match the globs
Expand Down Expand Up @@ -685,8 +683,6 @@ function list() {

function perms() {

require_ls

#; TODO: prevent repeats in the files changed

#; process relative to YADM_WORK
Expand Down Expand Up @@ -1041,13 +1037,6 @@ function require_gpg() {
function require_repo() {
[ -d "$YADM_REPO" ] || error_out "Git repo does not exist. did you forget to run 'init' or 'clone'?"
}
function require_ls() {
if [ ! -f "$LS_PROGRAM" ] ; then
command -v ls >/dev/null 2>&1 || \
error_out "This functionality requires 'ls' to be installed at '$LS_PROGRAM' or listed in your \$PATH"
LS_PROGRAM=ls
fi
}
function require_shell() {
[ -x "$SHELL" ] || error_out "\$SHELL does not refer to an executable."
}
Expand Down

0 comments on commit f23bdb8

Please sign in to comment.