Skip to content

fix(agent/agentcontainers): generate devcontainer metadata from schema #16881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 18, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: handle macos sed compat, transform before move
  • Loading branch information
johnstcn committed Mar 18, 2025
commit b5069f6b9ef59d363a3d146fae1154db95173a8a
10 changes: 8 additions & 2 deletions agent/agentcontainers/dcspec/gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@

# Format the generated code.
go run mvdan.cc/gofumpt@v0.4.0 -w -l "${TMPDIR}/${DEST_FILENAME}"
mv -v "${TMPDIR}/${DEST_FILENAME}" "${DEST_PATH}"

# Add a header so that Go recognizes this as a generated file.
sed -i '1s/^/\/\/ Code generated by dcspec\/gen.sh. DO NOT EDIT.\n/' "${DEST_PATH}"
if grep -q -- "\[-i extension\]" < <(sed -h 2>&1); then
# MacOS sed

Check warning on line 47 in agent/agentcontainers/dcspec/gen.sh

View workflow job for this annotation

GitHub Actions / lint

"MacOS" should be "macOS".
sed -i '' '1s/^/\/\/ Code generated by dcspec\/gen.sh. DO NOT EDIT.\n/' "${TMPDIR}/${DEST_FILENAME}"
else
sed -i'' '1s/^/\/\/ Code generated by dcspec\/gen.sh. DO NOT EDIT.\n/' "${TMPDIR}/${DEST_FILENAME}"
fi

mv -v "${TMPDIR}/${DEST_FILENAME}" "${DEST_PATH}"
Loading