Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 9 additions & 2 deletions scripts/zsh_cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@ openAIConfigPath="$CODEX_CLI_PATH/src/openaiapirc"
zshrcPath="$HOME/.zshrc"

# 1. Remove settings in .zshrc
sed -i '' '/### Codex CLI setup - start/,/### Codex CLI setup - end/d' $zshrcPath
# Check if the current system is Darwin (i.e. MacOS)
if [[ "$OSTYPE" == "Darwin" ]]; then
# Command to execute on MacOS
sed -i '' '/### Codex CLI setup - start/,/### Codex CLI setup - end/d' $zshrcPath
else
# Command to execute on Linux
sed -i '/### Codex CLI setup - start/,/### Codex CLI setup - end/d' $zshrcPath
fi
echo "Removed settings in $zshrcPath if present"

# 2. Remove opanaiapirc in /.config
rm -f $openAIConfigPath
echo "Removed $openAIConfigPath"

echo "Codex CLI clean up completed. Please open a new zsh to continue."
echo "Codex CLI clean up completed. Please open a new zsh to continue."
12 changes: 10 additions & 2 deletions scripts/zsh_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,15 @@ validateSettings()
configureZsh()
{
# Remove previous settings
sed -i '' '/### Codex CLI setup - start/,/### Codex CLI setup - end/d' $zshrcPath

# Check if the current system is Darwin (i.e. MacOS)
if [[ "$OSTYPE" == "Darwin" ]]; then
# Command to execute on MacOS
sed -i '' '/### Codex CLI setup - start/,/### Codex CLI setup - end/d' $zshrcPath
else
# Command to execute on Linux
sed -i '/### Codex CLI setup - start/,/### Codex CLI setup - end/d' $zshrcPath
fi
echo "Removed previous settings in $zshrcPath if present"

# Update the latest settings
Expand Down Expand Up @@ -116,4 +124,4 @@ echo -e "*** Setup complete! ***\n";
echo "***********************************************"
echo "Open a new zsh terminal, type '#' followed by"
echo "your natural language command and hit Ctrl + G!"
echo "***********************************************"
echo "***********************************************"