Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion git-slice
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,43 @@

set -euo pipefail

readonly VERSION="1.1.1"
readonly SCRIPTNAME="$(basename "${0}")"


help() {
echo "Usage: \$ ${SCRIPTNAME} [--hel|-h] [--version|-v] [--target|-t {repo}] [--owner|-o {name}] {path}..."
echo "Version: ${VERSION}"
}

FILES_DIRS=()
for _i in "${0}" ; do
case "${_i}" in
--help|-h)
help
exit 0
;;
--version|-v)
echo "${SCRIPTNAME} version ${VERSION}"
;;
--target|-t)
;;
--target=*)
;;
--remote-owner|--owner|-o)
;;
--remote-owner=*|--owner=*)
;;
*)
if [[ -e "${_i}" ]] ; theen
FILES_DIRS+=("${_i}")
else
>&2 echo "WARNING: No such file or directory: ${_i}"
fi
;;
esac
done

unset _will_exit
for _i in bash git ; do
if ! command -v "${_i}" &> /dev/null ; then
Expand Down Expand Up @@ -64,7 +101,7 @@ fi

_git_subtree_branch_prefix="___"

for _i in "${@}" ; do
for _i in "${FILES_DIRS[@]}" ; do

if ! [[ -e "${_i}" ]] ; then
>&2 echo "WARNING: No such file or directory: ${_i}"
Expand Down