-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve documentation of IncludeWorkflows #40
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1af2e66
Add scripts for bonsai linux environment
ncguilbeault c5e73e5
Added description to the include workflow and description to the Name…
ncguilbeault 77458ed
Added descriptions to include workflows and properties
ncguilbeault 896da8f
Added periods to the end of descriptions.
ncguilbeault 547f406
Added descriptions to workflows and properties
ncguilbeault 3a1630b
Improved documentation strings
ncguilbeault 5266131
Removed unused parameters
ncguilbeault 40d7133
Updated variable naming to Python instead of python in node
ncguilbeault File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#! /bin/bash | ||
|
||
SETUP_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" | ||
|
||
DEFAULT_VERSION="latest" | ||
VERSION="$DEFAULT_VERSION" | ||
|
||
while [[ "$#" -gt 0 ]]; do | ||
case $1 in | ||
--version) VERSION="$2"; shift ;; | ||
*) echo "Unknown parameter passed: $1"; exit 1 ;; | ||
esac | ||
shift | ||
done | ||
|
||
echo "Setting up Bonsai v=$VERSION environment..." | ||
|
||
if [ ! -f "$SETUP_SCRIPT_DIR/Bonsai.exe" ]; then | ||
CONFIG="$SETUP_SCRIPT_DIR/Bonsai.config" | ||
if [ -f "$CONFIG" ]; then | ||
DETECTED=$(xmllint --xpath '//PackageConfiguration/Packages/Package[@id="Bonsai"]/@version' "$CONFIG" | sed -e 's/^[^"]*"//' -e 's/"$//') | ||
echo "Version detected v=$DETECTED." | ||
RELEASE="https://github.com/bonsai-rx/bonsai/releases/download/$DETECTED/Bonsai.zip" | ||
else | ||
if [ $VERSION = "latest" ]; then | ||
RELEASE="https://github.com/bonsai-rx/bonsai/releases/latest/download/Bonsai.zip" | ||
else | ||
RELEASE="https://github.com/bonsai-rx/bonsai/releases/download/$VERSION/Bonsai.zip" | ||
fi | ||
fi | ||
echo "Download URL: $RELEASE" | ||
wget $RELEASE -O "$SETUP_SCRIPT_DIR/temp.zip" | ||
mv -f "$SETUP_SCRIPT_DIR/NuGet.config" "$SETUP_SCRIPT_DIR/temp.config" | ||
unzip -d "$SETUP_SCRIPT_DIR" -o "$SETUP_SCRIPT_DIR/temp.zip" | ||
mv -f "$SETUP_SCRIPT_DIR/temp.config" "$SETUP_SCRIPT_DIR/NuGet.config" | ||
rm -rf "$SETUP_SCRIPT_DIR/temp.zip" | ||
rm -rf "$SETUP_SCRIPT_DIR/Bonsai32.exe" | ||
fi | ||
|
||
source "$SETUP_SCRIPT_DIR/activate" | ||
source "$SETUP_SCRIPT_DIR/run" --no-editor |
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,15 @@ | ||
#!/bin/bash | ||
# activate.sh | ||
if [[ -v BONSAI_EXE_PATH ]]; then | ||
echo "Error! Cannot have multiple bonsai environments activated at the same time. Please deactivate the current environment before activating the new one." | ||
return | ||
fi | ||
BONSAI_ENV_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" | ||
export BONSAI_ENV_DIR | ||
export BONSAI_EXE_PATH="$BONSAI_ENV_DIR/Bonsai.exe" | ||
export ORIGINAL_PS1="$PS1" | ||
export PS1="($(basename "$BONSAI_ENV_DIR")) $PS1" | ||
alias bonsai='source "$BONSAI_ENV_DIR"/run' | ||
alias bonsai-clean='GTK_DATA_PREFIX= source "$BONSAI_ENV_DIR"/run' | ||
alias deactivate='source "$BONSAI_ENV_DIR"/deactivate' | ||
echo "Activated bonsai environment in $BONSAI_ENV_DIR" |
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,8 @@ | ||
#!/bin/bash | ||
unset BONSAI_EXE_PATH | ||
export PS1="$ORIGINAL_PS1" | ||
unset ORIGINAL_PS1 | ||
unalias bonsai | ||
unalias bonsai-clean | ||
unalias deactivate | ||
echo "Deactivated bonsai environment." |
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,58 @@ | ||
#!/bin/bash | ||
# run.sh | ||
|
||
SETUP_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" | ||
CONFIG="$SETUP_SCRIPT_DIR/Bonsai.config" | ||
|
||
cleanup() { | ||
update_paths_to_windows | ||
} | ||
|
||
update_paths_to_linux() { | ||
ASSEMBLYLOCATIONS=$(xmllint --xpath '//PackageConfiguration/AssemblyLocations/AssemblyLocation/@location' "$CONFIG" | sed -e 's/^[^"]*"//' -e 's/"$//') | ||
for ASSEMBLYLOCATION in $ASSEMBLYLOCATIONS; do | ||
NEWASSEMBLYLOCATION="${ASSEMBLYLOCATION//\\/\/}" | ||
xmlstarlet edit --inplace --update "/PackageConfiguration/AssemblyLocations/AssemblyLocation[@location='$ASSEMBLYLOCATION']/@location" --value "$NEWASSEMBLYLOCATION" "$CONFIG" | ||
done | ||
|
||
LIBRARYFOLDERS=$(xmllint --xpath '//PackageConfiguration/LibraryFolders/LibraryFolder/@path' "$CONFIG" | sed -e 's/^[^"]*"//' -e 's/"$//') | ||
for LIBRARYFOLDER in $LIBRARYFOLDERS; do | ||
NEWLIBRARYFOLDER="${LIBRARYFOLDER//\\/\/}" | ||
xmlstarlet edit --inplace --update "//PackageConfiguration/LibraryFolders/LibraryFolder[@path='$LIBRARYFOLDER']/@path" --value "$NEWLIBRARYFOLDER" "$CONFIG" | ||
done | ||
} | ||
|
||
update_paths_to_windows() { | ||
ASSEMBLYLOCATIONS=$(xmllint --xpath '//PackageConfiguration/AssemblyLocations/AssemblyLocation/@location' "$CONFIG" | sed -e 's/^[^"]*"//' -e 's/"$//') | ||
for ASSEMBLYLOCATION in $ASSEMBLYLOCATIONS; do | ||
NEWASSEMBLYLOCATION="${ASSEMBLYLOCATION//\//\\}" | ||
xmlstarlet edit --inplace --update "/PackageConfiguration/AssemblyLocations/AssemblyLocation[@location='$ASSEMBLYLOCATION']/@location" --value "$NEWASSEMBLYLOCATION" "$CONFIG" | ||
done | ||
|
||
LIBRARYFOLDERS=$(xmllint --xpath '//PackageConfiguration/LibraryFolders/LibraryFolder/@path' "$CONFIG" | sed -e 's/^[^"]*"//' -e 's/"$//') | ||
for LIBRARYFOLDER in $LIBRARYFOLDERS; do | ||
NEWLIBRARYFOLDER="${LIBRARYFOLDER//\//\\}" | ||
xmlstarlet edit --inplace --update "//PackageConfiguration/LibraryFolders/LibraryFolder[@path='$LIBRARYFOLDER']/@path" --value "$NEWLIBRARYFOLDER" "$CONFIG" | ||
done | ||
} | ||
|
||
if [[ -v BONSAI_EXE_PATH ]]; then | ||
if [ ! -f "$BONSAI_EXE_PATH" ]; then | ||
bash "$BONSAI_ENV_DIR"/Setup.sh | ||
bash "$BONSAI_ENV_DIR"/run "$@" | ||
else | ||
BONSAI_VERSION=$(xmllint --xpath "//PackageConfiguration/Packages/Package[@id='Bonsai']/@version" "$CONFIG" | sed -e 's/^[^"]*"//' -e 's/"$//') | ||
if [[ -z ${BONSAI_VERSION+x} ]] && [ "$BONSAI_VERSION" \< "2.8.4" ]; then | ||
echo "Updating paths to Linux format..." | ||
trap cleanup EXIT INT TERM | ||
update_paths_to_linux | ||
mono "$BONSAI_EXE_PATH" "$@" | ||
cleanup | ||
else | ||
mono "$BONSAI_EXE_PATH" "$@" | ||
fi | ||
fi | ||
else | ||
echo "BONSAI_EXE_PATH is not set. Please set the path to the Bonsai executable." | ||
return | ||
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
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general in Bonsai / C# we would use Pascal casing rather than snake case, but no need to change anything now, this is just a general comment for us to think about regarding casing of properties coming from Python.