Skip to content

Commit 637bee7

Browse files
committed
publish: fix when published folder is empty
1 parent 56a0574 commit 637bee7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

.actions/assistant.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -526,15 +526,15 @@ def group_folders(
526526
with open(fpath_gitdiff) as fopen:
527527
changed = [ln.strip() for ln in fopen.readlines()]
528528
dirs = [os.path.dirname(ln) for ln in changed]
529-
# not empty paths
530-
dirs = [ln for ln in dirs if ln]
531529

532530
if fpath_actual_dirs:
533531
assert isinstance(fpath_actual_dirs, list)
534532
assert all(os.path.isfile(p) for p in fpath_actual_dirs)
535533
dir_sets = [{ln.strip() for ln in open(fp).readlines()} for fp in fpath_actual_dirs]
536534
# get only different
537535
dirs += list(set.union(*dir_sets) - set.intersection(*dir_sets))
536+
# not empty paths
537+
dirs = [ln for ln in dirs if ln]
538538

539539
if root_path:
540540
dirs = [os.path.join(root_path, d) for d in dirs]

.actions/git-diff-sync.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
set -e
3+
set -ex
44
printf "Detect changes for: $1 >> $2\n\n"
55

66
b1="${1//'/'/'_'}"
@@ -30,8 +30,8 @@ printf "\n\n"
3030
git merge --ff -s resolve origin/$1
3131

3232
python _TEMP/.actions/assistant.py group-folders target-diff.txt --fpath_actual_dirs "['dirs-$b1.txt', 'dirs-$b2.txt']"
33-
printf "\n\nChanged folders:\n"
33+
printf "\n================\nChanged folders:\n----------------\n"
3434
cat changed-folders.txt
35-
printf "\n\nDropped folders:\n"
35+
printf "\n================\nDropped folders:\n----------------\n"
3636
cat dropped-folders.txt
3737
printf "\n"

.azure/ipynb-publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
displayName: "Install dependencies"
3838
- bash: |
3939
current_branch=$(cut -d '/' -f3- <<< $(Build.SourceBranch))
40-
printf "$current_branch\n"
40+
printf "Current branch: $current_branch\n"
4141
bash .actions/git-diff-sync.sh $current_branch $(PUB_BRANCH)
4242
displayName: "Compare changes & sync"
4343

0 commit comments

Comments
 (0)