Skip to content

Commit

Permalink
Allow sourcing of scripts/git-merge_main-to-all-ui.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
iva2k committed Feb 13, 2024
1 parent f49e9b6 commit b5cf71b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/git-merge_main-to-all-ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ git config user.email "[email protected]"
git config user.name "IVA2K"

function rebuild_lockfile() {
git checkout HEAD -- pnpm-lock.yaml && pnpm install && git add pnpm-lock.yaml
git checkout HEAD -- pnpm-lock.yaml && pnpm install && git add pnpm-lock.yaml
}
function rebuild_lockfile_and_commit() {
rebuild_lockfile && git commit -m "Update pnpm-lock.yaml"
Expand Down Expand Up @@ -41,7 +41,7 @@ function decolor() {
echo -e "$input" | sed 's/\x1B\[\([0-9]\{1,2\}\(;[0-9]\{1,2\}\)\?\)\?[mGK]//g'
}

function main() {
function merge_to_all() {
# Check that local repo is clean
if ! output=$(git status --untracked-files=no --porcelain 2>&1) || [ -n "$output" ]; then
# Working directory clean excluding untracked files
Expand Down Expand Up @@ -177,4 +177,5 @@ function main() {
return $result
}

main "@$"
(return 0 2>/dev/null) && sourced=1 || sourced=0
[ "$sourced" -eq 0 ] && merge_to_all "@$"

0 comments on commit b5cf71b

Please sign in to comment.