Compare commits
No commits in common. '44ff1cfdc136f7b09ada221bce0bf3a956912ce8' and '2db7a877c8f2a23a155618e0e9ffc0dbab5c104e' have entirely different histories.
44ff1cfdc1
...
2db7a877c8
@ -1,59 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
msg() {
|
|
||||||
echo >&2 -e "${1-}"
|
|
||||||
}
|
|
||||||
|
|
||||||
die() {
|
|
||||||
local msg=$1
|
|
||||||
local code=${2-1} # default exit status 1
|
|
||||||
msg "$msg"
|
|
||||||
simpledelay.sh 2 # short delay to aid reading last message in case terminal closes on exit
|
|
||||||
exit "$code"
|
|
||||||
}
|
|
||||||
|
|
||||||
parse_params() {
|
|
||||||
while :; do
|
|
||||||
case "${1-}" in
|
|
||||||
-?*) die "Unknown option: $1" ;;
|
|
||||||
*) break ;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
args=("$@")
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
parse_params "$@"
|
|
||||||
|
|
||||||
|
|
||||||
this_submod=${args[0]}
|
|
||||||
this_subtmp="${args[0]}_tmp"
|
|
||||||
# https://stackoverflow.com/a/16162228
|
|
||||||
|
|
||||||
msg "moving $this_submod to $this_subtmp"
|
|
||||||
mv $this_submod $this_subtmp
|
|
||||||
|
|
||||||
msg "git submodule deinit"
|
|
||||||
git submodule deinit $this_submod
|
|
||||||
|
|
||||||
msg "git rm $this_submod"
|
|
||||||
git rm $this_submod
|
|
||||||
|
|
||||||
msg "moving back $this_submod"
|
|
||||||
mv $this_subtmp $this_submod
|
|
||||||
|
|
||||||
msg "remove the existing .git file"
|
|
||||||
rm $this_submod/.git
|
|
||||||
|
|
||||||
msg "move the .git folder from modules into $this_submod"
|
|
||||||
mv .git/modules/$this_submod $this_submod/.git
|
|
||||||
|
|
||||||
msg "remove the worktree line from .git/config"
|
|
||||||
sed -i '/worktree/d' $this_submod/.git/config
|
|
||||||
|
|
||||||
msg "add $this_submod to .gitignore"
|
|
||||||
echo "$this_submod" >> .gitignore
|
|
Loading…
Reference in New Issue