Skip to content

Commit

Permalink
use git archive to include export-ignore files in 'orphaned_files' (#45)
Browse files Browse the repository at this point in the history
- export-ignore system root files from archive
  • Loading branch information
hemnstill authored Mar 4, 2024
1 parent b5529b1 commit 7beea7c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
.github/ export-ignore
.src/ export-ignore
.tests/ export-ignore

.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.mega-linter.yml export-ignore
.ruff.toml export-ignore
9 changes: 5 additions & 4 deletions _AutoinstallCreator/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ orphaned_files_filepath=$dp0/orphaned_files.txt
printf "$self_version"
} >"$version_filepath"

temp_dir_path="$dp0/.tmp"
rm -rf "$temp_dir_path" && mkdir -p "$temp_dir_path"

(cd "$dp0/.." && git archive --format tar --output "$temp_dir_path/git_archive_files.tar" HEAD)
{
comm -23 <(git log --pretty=format: --name-only --diff-filter=A | sort) \
<(cd "$dp0/.." && git ls-tree -r HEAD --name-only | sort) | uniq -u
<(tar --list --file "$temp_dir_path/git_archive_files.tar" | grep -v /$ | sort) | uniq -u
} >"$orphaned_files_filepath"

tool_version=release-2.5.0-cmd
Expand All @@ -34,9 +38,6 @@ makeself_sh_path="$makeself_target_path/makeself.sh"
tar -xf "$makeself_version_path"
}

temp_dir_path="$dp0/.tmp"
rm -rf "$temp_dir_path" && mkdir -p "$temp_dir_path"

release_version_dirpath="$temp_dir_path/$self_version"
tmp_version_path="$temp_dir_path/tmp_version.zip"
(cd "$dp0/.." && git archive --prefix "_$self_name/" --add-file="$version_filepath" --add-file="$orphaned_files_filepath" --prefix "" --format zip -1 --output "$tmp_version_path" HEAD)
Expand Down

0 comments on commit 7beea7c

Please sign in to comment.