Skip to content

Conversation

@rustydb
Copy link
Contributor

@rustydb rustydb commented Oct 21, 2025

Used the sanitizeEnv.sh script, made some changes:

  • Support BSD sed
  • printf shellcheck fix
  • suppress erroneous errors when file(s) don't exist

The script isn't executable and is missing a shebang, wasn't sure if there was a reason for that or not.

@0xxlegolas 0xxlegolas requested a review from Copilot October 21, 2025 10:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the sanitizeEnv.sh script to improve cross-platform compatibility and address shellcheck warnings. The changes add support for BSD sed (macOS), fix printf formatting issues, and gracefully handle missing files.

Key Changes:

  • Added OS detection to support both GNU and BSD sed syntax
  • Fixed printf statements to properly format color codes using format specifiers
  • Added file existence check to prevent errors when sanitizing non-existent files

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

This changes the code to handle running with either GNU or BSD `sed`.

macOS uses BSD `sed`, which expect an argument to be passed to `-i` unlike GNU `sed` which does not.
SC2059 'Don't use variables in the printf format string. Use printf '..%s..' "$foo"'
Prevent special characters from causing issues in the `sed` replacements.
@rustydb rustydb changed the title Sanitize update sanitizeEnv.sh update Oct 25, 2025
@CCP-2FaceMonkey CCP-2FaceMonkey self-requested a review November 24, 2025 09:41
Copy link
Contributor

@CCP-2FaceMonkey CCP-2FaceMonkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CCP-2FaceMonkey CCP-2FaceMonkey merged commit b131c1e into projectawakening:develop Nov 24, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants