Skip to content

Commit 6a256fb

Browse files
committed
use hidden dir
1 parent 19e8dae commit 6a256fb

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

.github/workflows/manual.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
fileName: "*.zst"
6565
tarBall: false
6666
zipBall: false
67-
out-file-path: "bkg"
67+
out-file-path: ".bkg"
6868

6969
- name: Dry run
7070
id: update

.github/workflows/update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
fileName: "*.zst"
5757
tarBall: false
5858
zipBall: false
59-
out-file-path: "bkg"
59+
out-file-path: ".bkg"
6060

6161
- name: Dry run
6262
id: update

src/test/update.sh

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,14 @@
88
root="$1"
99
[[ -n "$root" && ! "${root:0:2}" =~ -(m|d) ]] && shift || root="."
1010
[ -d "$root" ] || mkdir -p "$root"
11-
pushd "$root" || exit 1
12-
root="."
11+
[ -d "$root/.git" ] || { gh auth status &>/dev/null && gh repo clone "${GITHUB_OWNER:-ipitio}/${GITHUB_REPO:-backage}" "$root" -- --depth=1 -b "$GITHUB_BRANCH" --single-branch || git clone --depth=1 -b "$GITHUB_BRANCH" --single-branch "https://$([ -n "$GITHUB_TOKEN" ] && echo "$GITHUB_TOKEN@" || echo "")github.com/${GITHUB_OWNER:-ipitio}/${GITHUB_REPO:-backage}.git" "$root"; }
1312

14-
if [ ! -d .git ]; then
15-
mkdir -p .bkg
16-
pushd .bkg || exit 1
17-
gh auth status &>/dev/null && gh repo clone "${GITHUB_OWNER:-ipitio}/${GITHUB_REPO:-backage}" "." -- --depth=1 -b "$GITHUB_BRANCH" --single-branch || git clone --depth=1 -b "$GITHUB_BRANCH" --single-branch "https://$([ -n "$GITHUB_TOKEN" ] && echo "$GITHUB_TOKEN@" || echo "")github.com/${GITHUB_OWNER:-ipitio}/${GITHUB_REPO:-backage}.git" "."
18-
popd || exit 1
19-
shopt -s dotglob
20-
mv .bkg/* .
21-
rm -rf .bkg
22-
shopt -u dotglob
23-
fi
13+
# actions: move db into root
14+
shopt -s dotglob
15+
[ ! -d .bkg ] || mv .bkg/* "$root"/
16+
shopt -u dotglob
2417

18+
pushd "$root" || exit 1
2519
pushd src || exit 1
2620
source bkg.sh
2721
popd || exit 1
@@ -54,6 +48,7 @@ BKG_INDEX_DB=$BKG_ROOT/"$BKG_INDEX".db
5448
BKG_INDEX_SQL=$BKG_ROOT/"$BKG_INDEX".sql
5549
BKG_INDEX_DIR=$BKG_ROOT/"$BKG_INDEX"
5650
set +o allexport
51+
set -x
5752

5853
if git ls-remote --exit-code origin "$BKG_INDEX" &>/dev/null; then
5954
git worktree remove -f "$BKG_INDEX".bak &>/dev/null

0 commit comments

Comments
 (0)