Fix running Lua scripts that use temp dir ($t) on Windows

This commit is contained in:
David Capello 2019-12-11 14:44:29 -03:00
parent 47b3098c8b
commit e857b0e3e5
2 changed files with 8 additions and 2 deletions

View File

@ -2,7 +2,7 @@
# Copyright (C) 2018-2019 Igara Studio S.A.
function list_files() {
oldwd=$(pwd)
oldwd=$(pwd $PWDARG)
cd $1 && ls -1 *.*
cd $oldwd
}
@ -162,7 +162,7 @@ $ASEPRITE -b -script "$d/compare.lua" || exit 1
d=$t/save-as-without-path
mkdir $d
oldwd=$(pwd)
oldwd=$(pwd $PWDARG)
cd $d
$ASEPRITE -b -split-layers $oldwd/sprites/abcd.aseprite -save-as issue591.png || exit 1
if [[ ! -f "issue591 (a).png" ||

View File

@ -33,6 +33,12 @@ if [[ "$filter" != "" ]]; then
fi
t=$(mktemp -d)
if [[ "$(uname)" =~ "MINGW32" ]] || [[ "$(uname)" =~ "MSYS_NT-10.0" ]] ; then
PWDARG=-W
t=$(cd "$t" && pwd $PWDARG)
else
PWDARG=
fi
echo Temp dir: $t
export ASEPRITE_USER_FOLDER=$t