Skip to content

Commit

Permalink
Can't pass spaces through basename
Browse files Browse the repository at this point in the history
I can't get the bash quoting right to pass spaces through the basename and heredoc. Instead, set a variable, and just use that.
  • Loading branch information
directionless committed Oct 29, 2019
1 parent f730267 commit 8ff9cdc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/packaging/internal/assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/packaging/internal/assets/postinstall-launchd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/bin/launchctl stop com.{{.Identifier}}.launcher

if [ ! -z "{{.InfoFilename}}" ]; then
PACKAGE_FILENAME=$(basename "$PACKAGE_PATH")
cat <<EOF > "{{.InfoFilename}}"
{{.InfoJson}}
EOF
Expand Down
2 changes: 1 addition & 1 deletion pkg/packaging/packaging.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ func (p *PackageOptions) setupPostinst(ctx context.Context) error {
"identifier": p.Identifier,
"installer_id": "$INSTALL_PKG_SESSION_ID",
"download_path": "$PACKAGE_PATH",
"download_file": "$(basename \"$PACKAGE_PATH\")",
"download_file": "$PACKAGE_FILENAME",
"timestamp": "$(date +%Y-%m-%dT%T%z)",
"version": p.PackageVersion,
"user": "$USER",
Expand Down

0 comments on commit 8ff9cdc

Please sign in to comment.