Skip to content

Commit a9c9689

Browse files
authored
Merge pull request #357 from WhitewaterFoundry/development
Development
2 parents ffe0e70 + 4f4e11d commit a9c9689

File tree

17 files changed

+198
-37
lines changed

17 files changed

+198
-37
lines changed

pengwin-setup.d/docker.sh

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ declare WIN_CUR_VER
1414
#Imported global variables
1515
declare USER
1616

17+
#######################################
18+
# description
19+
# Globals:
20+
# GOPATH
21+
# GOROOT
22+
# GOVERSION
23+
# PATH
24+
# USER
25+
# wHome
26+
# Arguments:
27+
# None
28+
#######################################
1729
function docker_install_build_relay() {
1830
#Build the relay
1931
if [[ ! -f "${wHome}/.npiperelay/npiperelay.exe" ]]; then
@@ -75,7 +87,7 @@ function docker_install_build_relay() {
7587
PATH="$1"
7688
7789
# Check if we have Windows Path
78-
if ( which cmd.exe >/dev/null ); then
90+
if ( command -v cmd.exe >/dev/null ); then
7991
8092
connected=$(docker version 2>&1 | grep -c "daemon\|error")
8193
if [[ ${connected} != 0 ]]; then
@@ -98,7 +110,7 @@ EOF
98110
cat <<'EOF' >>docker_relay.sh
99111
100112
# Check if we have Windows Path
101-
if ( which cmd.exe >/dev/null ); then
113+
if ( command -v cmd.exe >/dev/null ); then
102114
sudo docker-relay "${PATH}"
103115
fi
104116
EOF
@@ -117,6 +129,14 @@ EOF
117129
sudo docker version
118130
}
119131

132+
#######################################
133+
# description
134+
# Globals:
135+
# DOCKER_HOST
136+
# connected
137+
# Arguments:
138+
# None
139+
#######################################
120140
function docker_install_conf_tcp() {
121141
echo "Connect to Docker via TCP"
122142

@@ -141,15 +161,20 @@ EOF
141161
fi
142162
}
143163

164+
#######################################
165+
# description
166+
# Arguments:
167+
# None
168+
#######################################
144169
function docker_install_conf_toolbox() {
145170
echo "Connect to Docker Toolbox"
146171

147172
cat <<'EOF' >>docker_relay.sh
148173
149174
# Check if we have Windows Path
150-
if ( which cmd.exe >/dev/null ); then
175+
if ( command -v cmd.exe >/dev/null ); then
151176
VM=${DOCKER_MACHINE_NAME-default}
152-
DOCKER_MACHINE="$(which docker-machine.exe)"
177+
DOCKER_MACHINE="$(command -v docker-machine.exe)"
153178
eval "$("${DOCKER_MACHINE}" env --shell=bash --no-proxy "${VM}" 2>/dev/null )" > /dev/null 2>&1
154179
155180
if [[ "${DOCKER_CERT_PATH}" != "" ]] ; then
@@ -165,6 +190,18 @@ EOF
165190
docker version
166191
}
167192

193+
#######################################
194+
# description
195+
# Globals:
196+
# DOCKER_COMPOSE_VERSION
197+
# DOCKER_VERSION
198+
# HOME
199+
# WIN_CUR_VER
200+
# Arguments:
201+
# None
202+
# Returns:
203+
# <unknown> ...
204+
#######################################
168205
function main() {
169206

170207
if (confirm --title "DOCKER" --yesno "Would you like to install the bridge to Docker?" 8 55); then
@@ -268,7 +305,7 @@ EOF
268305
cat <<'EOF' >>create-mnt-c-link.sh
269306
270307
# Check if we have Windows Path
271-
if ( which cmd.exe >/dev/null ); then
308+
if ( command -v cmd.exe >/dev/null ); then
272309
sudo create-mnt-c-link
273310
fi
274311

pengwin-setup.d/dotnet.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (confirm --title "DOTNET" --yesno "Would you like to download and install the
2424

2525
update_packages
2626

27-
install_packages dotnet-sdk-5.0
27+
install_packages dotnet-sdk-6.0
2828
cleantmp
2929

3030
if (confirm --title "NUGET" --yesno "Would you like to download and install NuGet?" 8 50) ; then

pengwin-setup.d/explorer.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ source "$(dirname "$0")/common.sh" "$@"
77
declare SetupDir
88

99

10+
#######################################
11+
# description
12+
# Globals:
13+
# wHome
14+
# Arguments:
15+
# None
16+
#######################################
1017
function install_explorer() {
1118

1219
local exec_name='pengwin.exe'
@@ -37,7 +44,7 @@ EOF
3744

3845
cp /usr/local/lib/pengwin.ico "${wHome}/Pengwin"
3946

40-
local fullexec=$(wslpath -m "$(which ${exec_name})" | sed 's$/$\\\\\\\\$g')
47+
local fullexec=$(wslpath -m "$(command -v ${exec_name})" | sed 's$/$\\\\\\\\$g')
4148
local icopath=$(cmd-exe /C "echo '%USERPROFILE%\\Pengwin\\pengwin.ico'" | tr -d '\r' | sed 's$\\$\\\\\\\\$g')
4249
icopath=$(echo $icopath | tr -d "\'")
4350
sed -i "s/_${plain_name}Path_/${fullexec}/g" Install.reg
@@ -62,6 +69,13 @@ EOF
6269
fi
6370
}
6471

72+
#######################################
73+
# description
74+
# Globals:
75+
# SKIP_CONFIMATIONS
76+
# Arguments:
77+
# None
78+
#######################################
6579
function upgrade_explorer() {
6680

6781
local plain_name='WLinux'
@@ -83,6 +97,11 @@ EOF
8397
install_explorer
8498
}
8599

100+
#######################################
101+
# description
102+
# Arguments:
103+
# 1
104+
#######################################
86105
function main() {
87106

88107
if [[ $# -gt 0 && "$1" == "--upgrade" ]]; then

pengwin-setup.d/guilib.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if (confirm --title "GUI Libraries" --yesno "Would you like to install a base se
3434
#!/bin/sh
3535
3636
# Check if we have Windows Path
37-
if ( which cmd.exe >/dev/null ); then
37+
if ( command -v cmd.exe >/dev/null ); then
3838
3939
eval "\$(timeout 2s dbus-launch --auto-syntax)"
4040
fi
@@ -47,7 +47,7 @@ EOF
4747
#!/bin/fish
4848
4949
# Check if we have Windows Path
50-
if which cmd.exe >/dev/null
50+
if command -q cmd.exe
5151
5252
for line in (timeout 2s dbus-launch | string match '*=*')
5353
set -l kv (string split -m 1 = -- \$line )

pengwin-setup.d/java.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ if (confirm --title "Java" --yesno "Would you like to Install SDKMan to manage a
1212
sudo tee "/etc/profile.d/sdkman.sh" <<EOF
1313
#!/bin/sh
1414
15+
if [ -n "\${XRDP_SESSION}" ]; then
16+
return
17+
fi
18+
1519
export SDKMAN_DIR="\${HOME}/.sdkman"
1620
if [ -s "\${HOME}/.sdkman/bin/sdkman-init.sh" ]; then
1721

pengwin-setup.d/lamp.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
# shellcheck source=./common.sh
44
source "$(dirname "$0")/common.sh" "$@"
55

6+
#######################################
7+
# description
8+
# Globals:
9+
# DEBIAN_FRONTEND
10+
# HOME
11+
# NON_INTERACTIVE
12+
# profile_start_lamp
13+
# Arguments:
14+
# None
15+
# Returns:
16+
# 1 ...
17+
#######################################
618
function install_lamp() {
719

820
if (confirm --title "LAMP Stack" --yesno "Would you like to install the LAMP Stack?" 10 60); then
@@ -113,10 +125,10 @@ EOF
113125

114126
profile_start_lamp="/etc/profile.d/start-lamp.sh"
115127
sudo tee "${profile_start_lamp}" <<EOF
116-
#!/bin/bash
128+
#!/bin/sh
117129
118130
# Check if we have Windows Path
119-
if ( which cmd.exe >/dev/null ); then
131+
if ( command -v cmd.exe >/dev/null ); then
120132
121133
sudo ${start_lamp}
122134
@@ -134,6 +146,11 @@ EOF
134146

135147
}
136148

149+
#######################################
150+
# description
151+
# Arguments:
152+
# None
153+
#######################################
137154
function main() {
138155

139156
install_lamp

pengwin-setup.d/nodejs.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,29 @@ echo "Look for Windows version of npm"
3838
NPM_WIN_PROFILE="/etc/profile.d/rm-win-npm-path.sh"
3939
NPM_PROFILE="/etc/profile.d/n-prefix.sh"
4040

41-
if [[ "$(which npm)" == $(wslpath 'C:\')* ]]; then
41+
if [[ "$(command -v npm)" == $(wslpath 'C:\')* ]]; then
4242

43-
if ! (confirm --title "npm in Windows" --yesno "npm is already installed in Windows in \"$(wslpath -m "$(which npm)")\".\n\nWould you still want to install the Linux version? This will hide the Windows version inside Pengwin." 12 80); then
43+
if ! (confirm --title "npm in Windows" --yesno "npm is already installed in Windows in \"$(wslpath -m "$(command -v npm)")\".\n\nWould you still want to install the Linux version? This will hide the Windows version inside Pengwin." 12 80); then
4444
echo "Skipping NODE"
4545
exit 1
4646
fi
4747

4848
sudo tee "${NPM_WIN_PROFILE}" <<EOF
49+
#!/bin/bash
4950
5051
# Check if we have Windows Path
51-
if ( which cmd.exe >/dev/null ); then
52+
if ( command -v cmd.exe >/dev/null ); then
5253
5354
WIN_C_PATH="\$(wslpath 'C:\')"
5455
5556
while [[ true ]]; do
5657
57-
WIN_YARN_PATH="\$(dirname "\$(which yarn)")"
58+
WIN_YARN_PATH="\$(dirname "\$(command -v yarn)")"
5859
if [[ "\${WIN_YARN_PATH}" == "\${WIN_C_PATH}"* ]]; then
5960
export PATH=\$(echo "\${PATH}" | sed -e "s#\${WIN_YARN_PATH}##")
6061
fi
6162
62-
WIN_NPM_PATH="\$(dirname "\$(which npm)")"
63+
WIN_NPM_PATH="\$(dirname "\$(command -v npm)")"
6364
if [[ "\${WIN_NPM_PATH}" == "\${WIN_C_PATH}"* ]]; then
6465
export PATH=\$(echo "\${PATH}" | sed -e "s#\${WIN_NPM_PATH}##")
6566
else
@@ -79,7 +80,7 @@ if [[ ${menu_choice} == *"NVERMAN"* ]]; then
7980

8081
echo "Installing n, Node.js version manager"
8182
curl -L https://git.io/n-install -o n-install.sh
82-
env SHELL="$(which bash)" bash n-install.sh -y #Force the installation to bash
83+
env SHELL="$(command -v bash)" bash n-install.sh -y #Force the installation to bash
8384

8485
N_PATH="$(cat ${HOME}/.bashrc | grep "^.*N_PREFIX.*$" | cut -d'#' -f 1)"
8586
echo "${N_PATH}" | sudo tee "${NPM_PROFILE}"

pengwin-setup.d/pythonpi.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ source "$(dirname "$0")/common.sh" "$@"
55

66
function install_pyenv() {
77

8-
if (confirm --title "PYTHON" --yesno "Would you like to download and install Python 3.9 with pyenv?" 8 70); then
8+
if (confirm --title "PYTHON" --yesno "Would you like to download and install Python 3.10 with pyenv?" 8 70); then
99
echo "Installing PYENV"
1010
createtmp
1111
install_packages make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
@@ -39,14 +39,14 @@ function install_pyenv() {
3939
echo 'status --is-interactive; and pyenv init -| source' >>"${HOME}"/.config/fish/config.fish
4040
fi
4141

42-
echo "Installing Python 3.9"
42+
echo "Installing Python 3.10"
4343
export PYENV_ROOT="$HOME/.pyenv"
4444
export PATH="$PYENV_ROOT/bin:$PATH"
4545
eval "$(pyenv init --path)"
4646
eval "$(pyenv init -)"
4747

48-
pyenv install -s 3.9.7
49-
pyenv global 3.9.7
48+
pyenv install -s 3.10.1
49+
pyenv global 3.10.1
5050

5151
touch "${HOME}"/.should-restart
5252

@@ -62,7 +62,7 @@ function install_pythonpip() {
6262
echo "Installing PYTHONPIP"
6363
createtmp
6464
install_packages build-essential python3.9 python3.9-distutils idle-python3.9 python3-pip python3-venv
65-
pip3 install -U pip
65+
pip3 install -U pip --no-warn-script-location
6666

6767
touch "${HOME}"/.should-restart
6868

@@ -96,7 +96,7 @@ function main() {
9696
local menu_choice=$(
9797
9898
menu --title "Python" --radiolist --separate-output "Python install options\n[SPACE to select, ENTER to confirm]:" 12 75 3 \
99-
"PYENV" 'Python 3.9 with pyenv ' off \
99+
"PYENV" 'Python 3.10 with pyenv ' off \
100100
"PYTHONPIP" 'Python 3.9, IDLE, and the pip package manager ' off \
101101
"POETRY" 'Python 3.9, IDLE, and the poetry package manager ' off
102102

pengwin-setup.d/services.sh

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ source "$(dirname "$0")/common.sh" "$@"
55

66
declare SetupDir
77

8+
#######################################
9+
# description
10+
# Arguments:
11+
# None
12+
# Returns:
13+
# 1 ...
14+
#######################################
815
function enable_rclocal() {
916

1017
if (confirm --title "rc.local" --yesno "Would you like to enable rc.local support for running scripts at Pengwin launch?" 10 60) ; then
@@ -29,10 +36,10 @@ EOF
2936

3037
local profile_rclocal="/etc/profile.d/rclocal.sh"
3138
sudo tee "${profile_rclocal}" << EOF
32-
#!/bin/bash
39+
#!/bin/sh
3340
3441
# Check if we have Windows Path
35-
if ( which cmd.exe >/dev/null ); then
42+
if ( command -v cmd.exe >/dev/null ); then
3643
3744
sudo ${cmd}
3845
fi
@@ -48,6 +55,16 @@ EOF
4855

4956
}
5057

58+
#######################################
59+
# description
60+
# Globals:
61+
# NON_INTERACTIVE
62+
# sshd_status
63+
# Arguments:
64+
# None
65+
# Returns:
66+
# 1 ...
67+
#######################################
5168
function enable_ssh() {
5269

5370
if (confirm --title "SSH Server" --yesno "Would you like to enable SSH Server?" 10 60) ; then
@@ -117,10 +134,10 @@ EOF
117134

118135
local profile_startssh="/etc/profile.d/start-ssh.sh"
119136
sudo tee "${profile_startssh}" << EOF
120-
#!/bin/bash
137+
#!/bin/sh
121138
122139
# Check if we have Windows Path
123-
if ( which cmd.exe >/dev/null ); then
140+
if ( command -v cmd.exe >/dev/null ); then
124141
125142
sudo ${startSsh}
126143
fi
@@ -133,6 +150,16 @@ EOF
133150

134151
}
135152

153+
#######################################
154+
# description
155+
# Globals:
156+
# SetupDir
157+
# Arguments:
158+
# None
159+
# Returns:
160+
# 1 ...
161+
# <unknown> ...
162+
#######################################
136163
function main() {
137164

138165
if [[ "$1" == "--enable-ssh" ]] ; then

0 commit comments

Comments
 (0)