Skip to content

Commit

Permalink
Use /bin/sh instead of /bin/bash.
Browse files Browse the repository at this point in the history
Not all systems have bash installed, and it does not required to CodeLite work.
  • Loading branch information
rozhuk-im authored and eranif committed Dec 1, 2019
1 parent 30d1508 commit f0a2771
Show file tree
Hide file tree
Showing 31 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion CodeLite/clConsoleBash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ wxFileName clConsoleBash::PrepareExecScript() const

if(!GetCommand().IsEmpty()) {
wxString fileContent;
fileContent << "#!/bin/bash\n";
fileContent << "#!/bin/sh\n";
fileContent << "command=\"" << GetCommand() << "\"\n";
wxString cdCommand;
#ifdef __WXOSX__
Expand Down
2 changes: 1 addition & 1 deletion CodeLite/clConsoleGnomeTerminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ wxString clConsoleGnomeTerminal::PrepareCommand()
if(hasCommand) {
wxFileName scriptPath = PrepareExecScript();
wxString rowCommand;
rowCommand << "/bin/bash -f \"" << scriptPath.GetFullPath() << "\"";
rowCommand << "/bin/sh -f \"" << scriptPath.GetFullPath() << "\"";
commandToExecute.Replace("%COMMAND%", rowCommand);
}
return commandToExecute;
Expand Down
2 changes: 1 addition & 1 deletion CodeLite/clConsoleRXVTerminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

clConsoleRXVTTerminal::clConsoleRXVTTerminal()
{
SetTerminalCommand("rxvt-unicode -cd %WD% -e /bin/bash -c '%COMMAND%'");
SetTerminalCommand("rxvt-unicode -cd %WD% -e /bin/sh -c '%COMMAND%'");
SetEmptyTerminalCommand("rxvt-unicode -cd %WD%");
}

Expand Down
2 changes: 1 addition & 1 deletion CodeLite/fileutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void FileUtils::OSXOpenDebuggerTerminalAndGetTTY(const wxString& path, const wxS
tmpfile << "/tmp/terminal.tty." << ::wxGetProcessId();
wxFileName helperScript("/tmp", "codelite-lldb-helper.sh");
wxString fileContent;
fileContent << "#!/bin/bash\n";
fileContent << "#!/bin/sh\n";
fileContent << "tty > " << tmpfile << "\n";
fileContent << "sleep 12345";
FileUtils::WriteFileContent(helperScript, fileContent);
Expand Down
2 changes: 1 addition & 1 deletion Docker/clDockerDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void clDockerDriver::AttachTerminal(const wxArrayString& names)

for(size_t i = 0; i < names.size(); ++i) {
wxString message;
command << " exec -i " << names.Item(i) << " /bin/bash -i";
command << " exec -i " << names.Item(i) << " /bin/sh -i";
FileUtils::OpenTerminal(clDockerWorkspace::Get()->GetFileName().GetPath(), command);
}
}
Expand Down
2 changes: 1 addition & 1 deletion InnoSetup/output/finalize-upload.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
upload=$1
if [ "${upload}" == "--upload" ]; then
cd /cygdrive/c/src/codelite/InnoSetup/output
Expand Down
2 changes: 1 addition & 1 deletion Runtime/clg++
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
codelite-cc g++ $@


2 changes: 1 addition & 1 deletion Runtime/clgcc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#!/bin/sh
codelite-cc gcc $@

2 changes: 1 addition & 1 deletion Runtime/codelite-fix-rpath
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
install_dir=$1
wx_libs=`ls -l ${install_dir}/libwx*.so|awk '{print $9;}'|xargs readlink|xargs readlink`
for lib in ${wx_libs}
Expand Down
8 changes: 4 additions & 4 deletions Runtime/codelite_xterm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

## A wrapper script around the xterm (or other terminal) utility
## which allows codelite to export LD_LIBRARY_PATH into the terminal shell
Expand All @@ -16,16 +16,16 @@ program_title=$1
if [ "$program_title" = "" ]; then
if [ "${LD_LIBRARY_PATH}" = "" ]; then
## LD_LIBRARY_PATH is not defined OR empty
## Run the terminal without the bash wrapper
## Run the terminal without the sh wrapper
${terminal} -T "codelite's shell" 2> /dev/null
fi
else
if [ "${LD_LIBRARY_PATH}" = "" ]; then
## LD_LIBRARY_PATH is not defined OR empty
## Run the terminal without the bash wrapper
## Run the terminal without the sh wrapper
${terminal} $3 -T "$program_title" -e $2 2> /dev/null
else
${terminal} $3 -T "$program_title" -e /bin/bash -c 'export LD_LIBRARY_PATH=$0;shift;$@' $LD_LIBRARY_PATH "$@" 2> /dev/null
${terminal} $3 -T "$program_title" -e /bin/sh -c 'export LD_LIBRARY_PATH=$0;shift;$@' $LD_LIBRARY_PATH "$@" 2> /dev/null
fi
fi

4 changes: 2 additions & 2 deletions cmake/Modules/OSXInstall.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ macro(CL_INSTALL_NAME_TOOL _findwhat_ _binary_)
if(APPLE)
install(CODE
"
execute_process(COMMAND /bin/bash -c \"otool -L ${_binary_} | grep ${_findwhat_} |grep -v executable_path \"
execute_process(COMMAND /bin/sh -c \"otool -L ${_binary_} | grep ${_findwhat_} |grep -v executable_path \"
OUTPUT_VARIABLE RESULT1
OUTPUT_STRIP_TRAILING_WHITESPACE
)
Expand All @@ -31,7 +31,7 @@ macro(CL_INSTALL_NAME_TOOL_EX _findwhat_ _replacewith_ _binary_)
if(APPLE)
install(CODE
"
execute_process(COMMAND /bin/bash -c \"otool -L ${_binary_} | grep ${_findwhat_} |grep -v executable_path \"
execute_process(COMMAND /bin/sh -c \"otool -L ${_binary_} | grep ${_findwhat_} |grep -v executable_path \"
OUTPUT_VARIABLE RESULT1
OUTPUT_STRIP_TRAILING_WHITESPACE
)
Expand Down
2 changes: 1 addition & 1 deletion codelite-icons-dark/pack-icons.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#!/bin/sh

git archive --format zip --output ../Runtime/codelite-icons-dark.zip master
2 changes: 1 addition & 1 deletion codelite-icons-fresh-farm/pack-icons.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
#!/bin/sh
git archive --format zip --output ../Runtime/codelite-icons-fresh-farm.zip master
2 changes: 1 addition & 1 deletion codelite-icons/pack-icons.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
#!/bin/sh
git archive --format zip --output ../Runtime/codelite-icons.zip master
2 changes: 1 addition & 1 deletion codelite_terminal/wxTerminalCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void wxTerminalCtrl::PostCreate()
shell << " /C " << m_startupCommand;
}
#else
shell = "/bin/bash";
shell = "/bin/sh";
if(!m_startupCommand.IsEmpty()) { shell << " -c '" << m_startupCommand << "'"; }
#endif
m_shell = ::CreateAsyncProcess(this, shell, IProcessCreateDefault | IProcessRawOutput, m_workingDirectory);
Expand Down
2 changes: 1 addition & 1 deletion codelitephp/resources/pack-resources.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#!/bin/sh

zip ../../Runtime/PHP.zip TestXDebugSettings.php cc/*.php
2 changes: 1 addition & 1 deletion make-weekly
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

# Keep the current folder
curdir=`pwd`
Expand Down
2 changes: 1 addition & 1 deletion svgs/svgs-dark/apt-cyg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# apt-cyg: install tool for Cygwin similar to debian apt-get
#
# The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion svgs/svgs-dark/convert-svg-to-png.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

## Convert SVG files into PNG
## A CodeLite script
Expand Down
2 changes: 1 addition & 1 deletion svgs/svgs-dark/create-logo-root.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
filename=codelite-logo-root

mkdir -p ../../bitmaps-dark/osx/icon.iconset
Expand Down
2 changes: 1 addition & 1 deletion svgs/svgs-dark/create-logo.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

file=codelite-logo.svg
filename=codelite-logo
Expand Down
2 changes: 1 addition & 1 deletion svgs/svgs-dark/update-modified-svgs.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#!/bin/sh

git status -s|grep -v "??"|grep "\.svg"| awk '{print $2;}'|xargs ./convert-single-file.sh
2 changes: 1 addition & 1 deletion svgs/svgs-light/apt-cyg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# apt-cyg: install tool for Cygwin similar to debian apt-get
#
# The MIT License (MIT)
Expand Down
2 changes: 1 addition & 1 deletion svgs/svgs-light/convert-svg-to-png.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

## Convert SVG files into PNG
## A CodeLite script
Expand Down
2 changes: 1 addition & 1 deletion svgs/svgs-light/create-logo-root.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
filename=codelite-logo-root

mkdir -p ../../bitmaps-light/osx/icon.iconset
Expand Down
2 changes: 1 addition & 1 deletion svgs/svgs-light/create-logo.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

file=codelite-logo.svg
filename=codelite-logo
Expand Down
2 changes: 1 addition & 1 deletion svgs/svgs-light/update-modified-svgs.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#!/bin/sh

git status -s|grep -v "??"|grep "\.svg"| awk '{print $2;}'|xargs ./convert-single-file.sh
2 changes: 1 addition & 1 deletion wxcrafter/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

mkdir -p /usr/local/share/wxGUICraft
cp -f wxgui.zip /usr/local/share/wxGUICraft
Expand Down
2 changes: 1 addition & 1 deletion wxcrafter/pack-osx.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
PWD=`pwd`
base_name=`basename $PWD`
echo $base_name
Expand Down
2 changes: 1 addition & 1 deletion wxcrafter/pack.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
PWD=`pwd`
base_name=`basename $PWD`
echo $base_name
Expand Down
2 changes: 1 addition & 1 deletion wxcrafter/resources/pack-icons.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#!/bin/sh

zip ../wxgui.zip *.png *.wxcp *.cpp *.h LICENSE

0 comments on commit f0a2771

Please sign in to comment.