summaryrefslogtreecommitdiff
path: root/manyplayer
diff options
context:
space:
mode:
authorNæþ'n Lasseter <Næþ'n Lasseter nathan@bytemark.co.uk>2015-12-19 23:09:50 +0000
committerNæþ'n Lasseter <Næþ'n Lasseter nathan@bytemark.co.uk>2015-12-19 23:09:50 +0000
commit5c894855532f4529c9b0c0f74688b918930ed359 (patch)
treef6c7ed040e0f450ced6d6ffa65e6440338c72754 /manyplayer
parent1d983c0175a85d53f4b3a51f8ec8d7e92ec30b31 (diff)
mkdir a directory if it doesn't exist and underscore spaces in THIS_DIR
Diffstat (limited to 'manyplayer')
-rwxr-xr-xmanyplayer6
1 files changed, 5 insertions, 1 deletions
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