forked from PrincetonUniversity/PsyNeuLinkView
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into feature/PSYNEU-139…
…-FIXES
- Loading branch information
Showing
9 changed files
with
121 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
shc -vrf linux.sh -o linux |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
|
||
RUN_FLAG=0 | ||
|
||
if [ $RUN_FLAG -eq 0 ]; then | ||
command -v xterm >/dev/null 2>&1 | ||
if [ $? -eq 0 ]; then | ||
xterm -fa 'Monospace' -fs 14 -hold -e "cd ~ && . .bashrc && curl -H \"Cache-Control: no-cache\" https://raw.githubusercontent.com/MetaCell/PsyNeuLinkView/develop/package/scripts/linux_installer.sh -o linux_installer.sh && chmod +x linux_installer.sh && ./linux_installer.sh && rm -f linux_installer.sh && bash" | ||
RUN_FLAG=1 | ||
fi | ||
fi | ||
|
||
if [ $RUN_FLAG -eq 0 ]; then | ||
command -v konsole >/dev/null 2>&1 | ||
if [ $? -eq 0 ]; then | ||
konsole --noclose -e "cd ~ && . .bashrc && curl -H \"Cache-Control: no-cache\" https://raw.githubusercontent.com/MetaCell/PsyNeuLinkView/develop/package/scripts/linux_installer.sh -o linux_installer.sh && chmod +x linux_installer.sh && ./linux_installer.sh && rm -f linux_installer.sh && bash" | ||
RUN_FLAG=1 | ||
fi | ||
fi | ||
|
||
|
||
if [ $RUN_FLAG -eq 0 ]; then | ||
command -v gnome-terminal >/dev/null | ||
if [ $? -eq 0 ]; then | ||
gnome-terminal -- bash -c "cd ~ && . .bashrc && curl -H \"Cache-Control: no-cache\" https://raw.githubusercontent.com/MetaCell/PsyNeuLinkView/develop/package/scripts/linux_installer.sh -o linux_installer.sh && chmod +x linux_installer.sh && ./linux_installer.sh && rm -f linux_installer.sh && bash" | ||
RUN_FLAG=1 | ||
fi | ||
fi | ||
|
||
if [ $RUN_FLAG -eq 0 ]; then | ||
command -v notify-send >/dev/null 2>&1 | ||
if [ $? -eq 0 ]; then | ||
notify-send "PsyNeuLinkViewer installation ERROR: No terminal found" "Try the manual installation documented in the github README." | ||
else | ||
xmessage -center -buttons 'Close':0 -default Ok -nearmouse "Error during the PsyNeuLinkViewer installation: No terminal found\nPlease try to download the linux installer bash script and run this manually from your terminal as documented in the repository README." | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
osascript -e 'tell app "Terminal" | ||
do script "cd ~ && curl -H \"Cache-Control: no-cache\" https://raw.githubusercontent.com/MetaCell/PsyNeuLinkView/develop/package/scripts/mac_installer.sh -o mac_installer.sh && chmod +x mac_installer.sh && ./mac_installer.sh && rm -f mac_installer.sh" | ||
end tell' > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
#!/bin/bash | ||
|
||
check_last_command () { | ||
if [[ $? -ne 0 ]]; then | ||
echo ">>> Please report the output below to [email protected] <<<" | ||
echo "Error: $1" | ||
python --version | ||
pip --version | ||
conda --version | ||
exit 1 | ||
fi | ||
} | ||
|
||
pip install -vv psyneulinkviewer --break-system-packages --use-pep517 && . ~/.profile && sudo chown root:root /usr/local/bin/psyneulinkviewer-linux-x64/chrome-sandbox && sudo chmod 4755 /usr/local/bin/psyneulinkviewer-linux-x64/chrome-sandbox | ||
check_last_command | ||
|
||
# Variables | ||
APP_NAME="PsyneulinkViewer" # Name of the application | ||
|
@@ -8,18 +21,8 @@ CONDA_ENV=$PSYNEULINK_ENV # Conda environment t | |
ICON_PATH="/usr/local/bin/psyneulinkviewer-linux-x64/resources/app/build/logo.png" # Path to the custom icon | ||
DESKTOP_FILE="$HOME/Desktop/$APP_NAME.desktop" # Path where the desktop shortcut will be created | ||
|
||
# Function to check if a conda environment is already active | ||
is_conda_active() { | ||
if [[ -n "$CONDA_DEFAULT_ENV" ]]; then | ||
echo "Conda environment '$CONDA_DEFAULT_ENV' is already active." | ||
return 0 | ||
else | ||
echo "No active conda environment found. Activating '$CONDA_ENV'..." | ||
return 1 | ||
fi | ||
} | ||
|
||
# Creating the .desktop file for the application | ||
rm -f "$DESKTOP_FILE" | ||
echo "[Desktop Entry]" > "$DESKTOP_FILE" | ||
echo "Version=1.0" >> "$DESKTOP_FILE" | ||
echo "Name=$APP_NAME" >> "$DESKTOP_FILE" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
#!/bin/bash | ||
check_last_command () { | ||
if [[ $? -ne 0 ]]; then | ||
echo ">>> Please report the output below to [email protected] <<<" | ||
echo "Error: $1" | ||
python --version | ||
pip --version | ||
conda --version | ||
exit 1 | ||
fi | ||
} | ||
|
||
|
||
pip install -vv psyneulinkviewer --break-system-packages --use-pep517 && source ~/.bashrc_profile | ||
check_last_command | ||
|
||
# Variables - adjust these for your setup | ||
APP_PATH="$HOME/psyneulinkviewer-darwin-x64/psyneulinkviewer.app/" # Replace with the full path to the application | ||
|
@@ -14,21 +27,12 @@ COMMAND_FILE_PATH="$APP_SHORTCUT_PATH/Contents/MacOS/$SHORTCUT_NAME" | |
ICON_FILE_PATH="$APP_SHORTCUT_PATH/Contents/Resources/$SHORTCUT_NAME.icns" | ||
|
||
# Create .app structure | ||
rm -rf "$APP_SHORTCUT_PATH" | ||
mkdir -p "$APP_SHORTCUT_PATH/Contents/MacOS" | ||
mkdir -p "$APP_SHORTCUT_PATH/Contents/Resources" | ||
|
||
# Function to check if a conda environment is active | ||
is_conda_active() { | ||
# Check if the CONDA_DEFAULT_ENV variable is set, meaning a conda environment is active | ||
if [ -z "$CONDA_DEFAULT_ENV" ]; then | ||
return 1 # No active conda environment | ||
else | ||
return 0 # A conda environment is already active | ||
fi | ||
} | ||
|
||
# Write the .command file that launches the app with conda environment | ||
cat <<EOL > "$COMMAND_FILE_PATH" | ||
#!/bin/bash | ||
source ~/.bashrc_profile | ||
source ~/miniconda3/etc/profile.d/conda.sh | ||
|
@@ -71,4 +75,3 @@ chmod -R 755 "$APP_SHORTCUT_PATH" | |
touch "$APP_SHORTCUT_PATH" | ||
|
||
echo "Shortcut created at $DESKTOP_PATH/$SHORTCUT_NAME.app" | ||
|