Skip to content

Commit

Permalink
Launchcontrol App Concept
Browse files Browse the repository at this point in the history
  • Loading branch information
albertstarfield committed Mar 6, 2024
1 parent 23e51f6 commit 7d5c48c
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 119 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ usr/nodeLocalRuntime
**/*Mem.json
**/*.log
usr/storage/foreverEtchedFirstHandExperienced.json
builder-tool/autoEasySetup/Adelaide Zephyrine Charlotte.app
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ That's it! You're ready to go.
> **Note**
> For Windows the launch sequence command are currently broken, You could try running the following command but it is under heavy development, you can see the update on the Issue section about Windows Native Support. In the meantime you could run it using wsl2 and wslg
### Linux and macOS
### Linux and macOS (Running manually)

> The procedure will encompass an automated compilation process, wherein all components shall be seamlessly and effortlessly installed. Consequently, the necessity for specific release binaries shall be obviated.
Expand All @@ -74,11 +74,11 @@ That's it! You're ready to go.
>
>Install application specific dependencies:
>
> ```chmod +x ./run.sh ```
> ```chmod +x ./launchcontrol/run.sh ```
>
> Run it
>
> ```./run.sh```
> ```./launchcontrol/run.sh```

3. The program will commence automatically, affording you the opportunity to initiate a conversation at your convenience.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Adelaide Zephyrine Charlotte</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<key>CFBundleIdentifier</key>
<string>com.example.Adelaide Zephyrine Charlotte</string>
<string>com.example.Adelaide-Zephyrine-Charlotte</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand All @@ -18,11 +18,7 @@
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSAppleScriptEnabled</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,28 +1,49 @@
#!/bin/bash
#Wrapper to launch exec_L1 from osascript Launching Terminal
echo "Extracting Wrapper L1"
cat > /tmp/exec_L1 << EOL
#!/bin/bash
# Check if Homebrew is installed
# Check if brew command is detected, if not, install Homebrew
if ! command -v brew &> /dev/null; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "Installing Homebrew..."
/bin/bash -c "\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# Update Homebrew
echo "Updating Homebrew..."
brew update
# Upgrade packages
brew upgrade -y
# Upgrade installed packages
echo "Upgrading installed packages..."
brew upgrade
# Update Homebrew
echo "Updating Homebrew..."
brew update
# Install git if not installed
# Check if git command is detected, if not, install it using brew
if ! command -v git &> /dev/null; then
brew install git -y
echo "Installing git..."
brew install git
fi
# Clone repository if run.sh not detected
if [ ! -f "/Users/user/adelaide-zephyrine-charlotte-assistant/launchcontrol/run.sh" ]; then
git clone https://github.com/albertstarfield/alpaca-electron-zephyrine "/Users/user/adelaide-zephyrine-charlotte-assistant"
# 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
osascript -e 'tell application "Terminal" to do script "bash /Users/user/adelaide-zephyrine-charlotte-assistant/launchcontrol/run.sh"'
# Launch terminal and execute run.sh script
echo "Launching terminal..."
osascript -e 'tell application "Terminal" to do script "bash \$HOME/adelaide-zephyrine-charlotte-assistant/launchcontrol/run.sh"'
# Wait for 15 seconds
# 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
49 changes: 49 additions & 0 deletions builder-tool/macOSdarwinBundle/exec_L0
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash
#Wrapper to launch exec_L1 from osascript Launching Terminal
echo "Extracting Wrapper L1"
cat > /tmp/exec_L1 << EOL
#!/bin/bash
# Check if brew command is detected, if not, install Homebrew
if ! command -v brew &> /dev/null; then
echo "Installing Homebrew..."
/bin/bash -c "\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# Update Homebrew
echo "Updating Homebrew..."
brew update
# Upgrade installed packages
echo "Upgrading installed packages..."
brew upgrade
# Update Homebrew
echo "Updating Homebrew..."
brew update
# Check if git command is detected, if not, install it using brew
if ! command -v git &> /dev/null; then
echo "Installing git..."
brew install git
fi
# 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..."
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
51 changes: 51 additions & 0 deletions builder-tool/macOSdarwinBundle/maclauncherbuilder.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/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

# Create the .app directory structure
mkdir -p "./builder-tool/autoEasySetup/Adelaide Zephyrine Charlotte.app/Contents/MacOS"
mkdir -p "./builder-tool/autoEasySetup/Adelaide Zephyrine Charlotte.app/Contents/Resources"

# Copy the icon file
cp "usr/icon/mac/icon.icns" "./builder-tool/autoEasySetup/Adelaide Zephyrine Charlotte.app/Contents/Resources/"

# Create the Info.plist file
cat > "./builder-tool/autoEasySetup/Adelaide Zephyrine Charlotte.app/Contents/Info.plist" <<EOL
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Adelaide Zephyrine Charlotte</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<key>CFBundleIdentifier</key>
<string>com.example.Adelaide-Zephyrine-Charlotte</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Adelaide Zephyrine Charlotte</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
EOL

# Create the executable bash script
cat ./builder-tool/macOSdarwinBundle/exec_L0 > "./builder-tool/autoEasySetup/Adelaide Zephyrine Charlotte.app/Contents/MacOS/Adelaide Zephyrine Charlotte"


# Make the script executable
chmod +x "./builder-tool/autoEasySetup/Adelaide Zephyrine Charlotte.app/Contents/MacOS/Adelaide Zephyrine Charlotte"

echo "App assembled successfully!"
98 changes: 0 additions & 98 deletions builder-tool/maclauncherbuilder.sh

This file was deleted.

File renamed without changes.

0 comments on commit 7d5c48c

Please sign in to comment.