-
Notifications
You must be signed in to change notification settings - Fork 1
/
install-cygwin.sh
57 lines (51 loc) · 1.95 KB
/
install-cygwin.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
OS=`uname | grep -Eo '^[A-Za-z]+'`
BASEURL="https://github.com/mittelmark/microemacs/releases/download/v09.12.24.beta3/"
KERNEL=`uname -r | grep -Eo '^[0-9]+'`
MECB="cygwin-3.5-microemacs-091224b3-mecb"
MEWB="cygwin-3.5-microemacs-091224b3-mewb"
function install-me {
cd ~
if [[ ! -f ~/.local/bin/mecb ]]; then
if [ ! -d ~/.local/bin ]; then
mkdir -p ~/.local/bin
fi
# Check if ~/bin is already in the PATH
if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
# If it's not in the PATH, add it to ~/.bashrc
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
# Update the PATH for the current session
export PATH="$HOME/.local/bin:$PATH"
echo "To update the current Bash session with the new PATH variable use: 'source ~/.bashrc'"
fi
# Download the dummy.sh script from the internet
URL=${BASEURL}${MECB}
if [[ ! -f "${MECB}.zip" ]]; then
curl -fsSL "${URL}.zip" -o ${MECB}.zip
fi
unzip -p "${MECB}.zip" $MECB/bin/mecb.exe > ~/.local/bin/mecb.exe
URL=${BASEURL}${MEWB}
if [[ ! -f "${MEWB}.zip" ]]; then
curl -fsSL "${URL}.zip" -o ${MEWB}.zip
fi
unzip -p "${MEWB}.zip" $MEWB/bin/mewb.exe > ~/.local/bin/mewb.exe
# Make the script executable
if [[ ! -f ~/.local/bin/me ]]; then
curl -fsSL https://raw.githubusercontent.com/mittelmark/microemacs/refs/heads/master/install-cygwin.sh -o me
cp me ~/.local/bin/
fi
chmod 755 ~/.local/bin/me*
echo "Installation complete."
fi
}
#/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/mittelmark/microemacs/refs/heads/master/install-linux.sh)"
install-me
if [[ $1 == "-w" ]]; then
shift
~/.local/bin/mewb.exe "$@"
elif [[ $1 == "-n" ]]; then
shift
~/.local/bin/mecb.exe "$@"
else
~/.local/bin/mecb.exe "$@"
fi