fix (samples): replace sed -i '' with perl -i -pe for Linux/WSL compatibility#44
Conversation
|
Thanks Ben, we're looking to get a VM to test this out and merge it in. Also looking to build something in our CICD to ensure compatibility and avoid these kind of issues long term! |
|
|
||
| # Update staging_schema | ||
| sed -i '' "s|staging_schema:.*|staging_schema: $catalog.${schema_namespace}_staging${logical_env}|" "$substitutions_file" | ||
| perl -i - pe "s|staging_schema:.*|staging_schema: $catalog.${schema_namespace}_staging${logical_env}|" "$substitutions_file" |
There was a problem hiding this comment.
'- pe' is causing an issue, I believe it should be '-pe'
There was a problem hiding this comment.
You are correct it should be "-pe", I've made that change to the branch.
There is a disconnect between the client-side environment that tested the change and the fork I used for the PR, apologies for the error.
There was a problem hiding this comment.
Looks good now thanks. Please manually update version file to 0.12.1 (github actions are currently disabled) and I'll approve
There was a problem hiding this comment.
version updated to 0.12.1
Fixes #43 - Raised bug to document the issue
Problem
samples/common.shusessed -i ''which is macOS-specific syntax. On Linux and WSL this silently fails, leaving pipeline config files (e.g.pipeline_configs/dev_substitutions.json) without the necessary substitutions, causing sample pipelines to fail.Solution
Replaced
sed -i ''withperl -i -pewhich performs the same in-place substitution but works cross-platform (macOS, Linux, WSL).Testing
samples/deploy.shand confirmed substitutions are correctly applied to pipeline config files