DT
Size: a a a
DT
DT
man bash
L
DT
git status -s
и проверяем, пустой он или нетDT
DT
--index
для применения стэша, чтобы восстановить индексDT
L
L
L
L
L
DT
L
npm run test;
exit 0;
DT
DT
#!/bin/sh
if [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" != "true" ];
then
echo 'Not a git repo.';
exit 1;
fi;
CMD="$*"
if [ -n "$(git status -s)" ];
then
git stash push -aq;
$CMD;
git stash pop -q --index;
else
$CMD;
fi;
L
DT
run_on_clean npm run test
типа