From 5c894855532f4529c9b0c0f74688b918930ed359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A6=C3=BE=27n=20Lasseter?= Date: Sat, 19 Dec 2015 23:09:50 +0000 Subject: mkdir a directory if it doesn't exist and underscore spaces in THIS_DIR --- manyplayer | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'manyplayer') diff --git a/manyplayer b/manyplayer index 5f2d7ee..6f55535 100755 --- a/manyplayer +++ b/manyplayer @@ -8,7 +8,9 @@ if [ "x${MANYPLAYER_BASE_DIR}" == "x" ] ; then MANYPLAYER_BASE_DIR=~/.manyplayer fi -THIS_DIR=${PWD//\//_} +THIS_DIR=${PWD} +THIS_DIR=${THIS_DIR//\//_} +THIS_DIR=${THIS_DIR// /_} MANYPLAYER_DIR=${MANYPLAYER_BASE_DIR}/${THIS_DIR} exe=$(basename $0) @@ -58,6 +60,8 @@ function tell_last_file { } function setup { + [ -d ${MANYPLAYER_DIR} ] || mkdir ${MANYPLAYER_DIR} + local guess=$(echo *$1*) local name=${guess/$1/!} echo -n $name > ${MANYPLAYER_DIR}/filename -- cgit v1.2.1