Last active
June 19, 2018 11:11
-
-
Save yuru4c/e36d7400004924fcf7851a7e8ad2b1fe to your computer and use it in GitHub Desktop.
与えられたフォルダの -0 -D な zip を作成 (bash 必須)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:<<! | |
@ECHO OFF | |
SETLOCAL ENABLEDELAYEDEXPANSION | |
CALL :mnt "%~0" this | |
CALL :mnt "%~1" that | |
bash %this% %that% | |
EXIT /B | |
:mnt | |
SET d=%~d1 | |
SET d=%d:~0,-1% | |
FOR %%I IN (a b c d e f g h i j k l m n o p q r s t u v w x y z) DO SET d=!d:%%I=%%I! | |
SET "pnx=%~pnx1" | |
SET "pnx=%pnx:\=/%" | |
SET %2="/mnt/%d%%pnx%" | |
EXIT /B | |
! | |
w() { | |
for n in "$@"; do | |
echo "'$n' '*/$n'" | |
done | |
} | |
if [ -d "$1" ]; then | |
pushd "$1" > /dev/null | |
eval zip -0 -D -r '"../${PWD##*/}.zip"' . -x `w .DS_Store desktop.ini Thumbs.db` | |
popd > /dev/null | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment