mirror of
https://gitlab.com/ProcyonLotor/vrchat-template.git
synced 2026-08-25 10:43:53 +05:00
Added shell scripts for repository cleanup
This commit is contained in:
5
.gitattributes
vendored
5
.gitattributes
vendored
@@ -97,3 +97,8 @@
|
|||||||
# Binaries
|
# Binaries
|
||||||
*.dll filter=lfs diff=lfs merge=lfs -text
|
*.dll filter=lfs diff=lfs merge=lfs -text
|
||||||
*.exe filter=lfs diff=lfs merge=lfs -text
|
*.exe filter=lfs diff=lfs merge=lfs -text
|
||||||
|
|
||||||
|
# Shell scripts
|
||||||
|
*.bat text eol=crlf
|
||||||
|
*.cmd text eol=crlf
|
||||||
|
*.sh text eol=lf
|
||||||
|
|||||||
26
repo-cleanup.cmd
Normal file
26
repo-cleanup.cmd
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
@ECHO OFF
|
||||||
|
TITLE Clean up Unity Project repo
|
||||||
|
SETLOCAL EnableDelayedExpansion
|
||||||
|
|
||||||
|
CALL :cleanup --dry-run || GOTO die
|
||||||
|
|
||||||
|
CHOICE /M "Execute"
|
||||||
|
IF !ERRORLEVEL! NEQ 1 (
|
||||||
|
ECHO Aborting cleanup...
|
||||||
|
) ELSE (
|
||||||
|
CALL :cleanup || GOTO die
|
||||||
|
ECHO Done.
|
||||||
|
)
|
||||||
|
|
||||||
|
:end
|
||||||
|
PAUSE
|
||||||
|
EXIT /B 0
|
||||||
|
|
||||||
|
:die
|
||||||
|
PAUSE
|
||||||
|
EXIT /B %ERRORLEVEL%
|
||||||
|
|
||||||
|
|
||||||
|
:cleanup
|
||||||
|
git clean -dfX %* "%~dp0." || EXIT /B
|
||||||
|
EXIT /B 0
|
||||||
30
repo-cleanup.sh
Executable file
30
repo-cleanup.sh
Executable file
@@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
me="$(realpath "$0")"
|
||||||
|
repository="$(dirname "$me")/."
|
||||||
|
|
||||||
|
# I have no mouth but i must scream
|
||||||
|
if [ ! -t 0 ]; then
|
||||||
|
if command -v x-terminal-emulator >/dev/null 2>&1; then
|
||||||
|
x-terminal-emulator -e "$me"
|
||||||
|
elif command -v xdg-terminal >/dev/null 2>&1; then
|
||||||
|
xdg-terminal "$me"
|
||||||
|
else
|
||||||
|
echo "Run me from the fucking terminal!" >"${me}.README"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
git clean -dfX --dry-run "${repository}"
|
||||||
|
|
||||||
|
printf "Execute [Y,N]?"; read -r yn
|
||||||
|
if [ "$yn" = "${yn#[Yy]}" ] ;then
|
||||||
|
echo "Aborting cleanup..."
|
||||||
|
else
|
||||||
|
git clean -dfX "${repository}"
|
||||||
|
echo "Done."
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf "Press any key to continue..."; read -r _
|
||||||
|
exit 0
|
||||||
Reference in New Issue
Block a user