Skip to content

Commit

Permalink
Linux launcher builder added
Browse files Browse the repository at this point in the history
  • Loading branch information
albertstarfield committed Mar 6, 2024
1 parent 7d5c48c commit e29c086
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 80 deletions.
44 changes: 44 additions & 0 deletions builder-tool/LinuxSpecificInstaller/exec_L0
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash
appName = "adelaide-zephyrine-charllote"
install_dependencies_linux() {
# Detect package manager
if command -v apt-get &> /dev/null; then
# Install required packages using apt-get
sudo apt-get update
sudo apt-get install -y git
elif command -v dnf &> /dev/null; then
# Install required packages using dnf (Fedora)
sudo dnf install -y git
elif command -v yum &> /dev/null; then
# Install required packages using yum (CentOS)
sudo yum install -y git
elif command -v zypper &> /dev/null; then
# Install required packages using zypper (openSUSE)
sudo zypper install -y git
elif command -v swupd &> /dev/null; then
sudo swupd bundle-add git
else
echo "Unsupported package manager or unable to install dependencies. Exiting."
exit 1
fi

}

install_dependencies_linux

# Check if run.sh script exists, if not, clone the repository
if [ ! -f "\$HOME/adelaide-zephyrine-charlotte-assistant/launchcontrol/run.sh" ]; then
echo "Cloning repository..."
git clone --depth=1 https://github.com/albertstarfield/alpaca-electron-zephyrine "\$HOME/adelaide-zephyrine-charlotte-assistant"
fi

# Launch terminal and execute run.sh script
echo "Launching terminal..."
bash $HOME/adelaide-zephyrine-charlotte-assistant/launchcontrol/run.sh
echo "Copying to /usr/bin"
content="$(cat ${0})"
cat "${content}" > /usr/bin/${appName}
chmod +x /usr/bin/${appName}

echo "Your program is now installed you can execute it again on the shell"
echo "$ ${appName}"
10 changes: 10 additions & 0 deletions builder-tool/LinuxSpecificInstaller/linuxlauncherbuilder.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# Check if the necessary directories exist
if [ ! -d "usr" ] || [ ! -d "launchcontrol" ]; then
echo "Error: Make sure you are on the root directory of the project and you can launch like bash ./builder-tool/macOSdarwinBundle/maclauncherbuilder.sh"
exit 1
fi

echo "Bruh Linux is just as easy as launching it through the terminal and all is done! :D"
cp ./builder-tool/LinuxSpecificInstaller/exec_L0 ./builder-tool/autoEasySetup/adelaide-zephyrine-charlotte

This file was deleted.

This file was deleted.

44 changes: 44 additions & 0 deletions builder-tool/autoEasySetup/adelaide-zephyrine-charlotte
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash
appName = "adelaide-zephyrine-charllote"
install_dependencies_linux() {
# Detect package manager
if command -v apt-get &> /dev/null; then
# Install required packages using apt-get
sudo apt-get update
sudo apt-get install -y git
elif command -v dnf &> /dev/null; then
# Install required packages using dnf (Fedora)
sudo dnf install -y git
elif command -v yum &> /dev/null; then
# Install required packages using yum (CentOS)
sudo yum install -y git
elif command -v zypper &> /dev/null; then
# Install required packages using zypper (openSUSE)
sudo zypper install -y git
elif command -v swupd &> /dev/null; then
sudo swupd bundle-add git
else
echo "Unsupported package manager or unable to install dependencies. Exiting."
exit 1
fi

}

install_dependencies_linux

# Check if run.sh script exists, if not, clone the repository
if [ ! -f "\$HOME/adelaide-zephyrine-charlotte-assistant/launchcontrol/run.sh" ]; then
echo "Cloning repository..."
git clone --depth=1 https://github.com/albertstarfield/alpaca-electron-zephyrine "\$HOME/adelaide-zephyrine-charlotte-assistant"
fi

# Launch terminal and execute run.sh script
echo "Launching terminal..."
bash $HOME/adelaide-zephyrine-charlotte-assistant/launchcontrol/run.sh
echo "Copying to /usr/bin"
content="$(cat ${0})"
cat "${content}" > /usr/bin/${appName}
chmod +x /usr/bin/${appName}

echo "Your program is now installed you can execute it again on the shell"
echo "$ ${appName}"
8 changes: 1 addition & 7 deletions builder-tool/macOSdarwinBundle/exec_L0
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
#Wrapper to launch exec_L1 from osascript Launching Terminal
#Wrapper to launch exec_L1 from osascript Launching Terminal so its viewable
echo "Extracting Wrapper L1"
cat > /tmp/exec_L1 << EOL
#!/bin/bash
Expand Down Expand Up @@ -38,12 +38,6 @@ fi
echo "Launching terminal..."
osascript -e 'tell application "Terminal" to do script "bash \$HOME/adelaide-zephyrine-charlotte-assistant/launchcontrol/run.sh"'
# Sleep for 15 seconds
echo "Waiting for 15 seconds..."
sleep 15
open -a safari
EOL
osascript -e 'tell application "Terminal" to do script "/bin/bash -c \"bash /tmp/exec_L1 ; rm /tmp/exec_L1 ; exit\"'\"
sleep 60

0 comments on commit e29c086

Please sign in to comment.