-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: download and update node bridge from Suite dev server
- Loading branch information
Showing
4 changed files
with
37 additions
and
0 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
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,14 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
HERE=$(dirname $(readlink -f $0)) | ||
|
||
FILE_NAME="bin.js" | ||
FILE_LOCATION="$HERE/$FILE_NAME" | ||
# BRANCH="develop" | ||
BRANCH="grdddj/ci_node_bridge_build" | ||
URL="https://dev.suite.sldev.cz/transport-bridge/$BRANCH/dist/$FILE_NAME" | ||
|
||
# Downloading and modifying node bridge bin.js file | ||
nix-shell --run "curl -L $URL -o $FILE_LOCATION" || echo "Failed to download $FILE_NAME" | ||
nix-shell --run "$HERE/modify_node_bin_js.sh $FILE_LOCATION" || echo "Failed to modify $FILE_NAME" |
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,21 @@ | ||
#!/bin/bash | ||
|
||
if [ -z "$1" ]; then | ||
echo "Please supply the path to the file to modify" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -f "$1" ]; then | ||
echo "Error: File '$1' not found." | ||
exit 1 | ||
fi | ||
|
||
# Getting rid of USB import, which is not needed when we will spawn in with UDP argument | ||
string_to_comment='^var import_usb =' | ||
if grep -q "$string_to_comment" "$1"; then | ||
sed -i "/$string_to_comment/ s/^/\/\//" "$1" | ||
echo "Success: line matching '$string_to_comment' was commented out." | ||
else | ||
echo "Error: no line matching '$string_to_comment' found in '$1'." | ||
exit 1 | ||
fi |