#!/bin/bash
set -e
# # this script decides whether or not to start
# server in harmony mode, depending on Node
# version.
MAX_HARMONY_VERSION=5
NODE_VERSION=$(node -v | grep -o 'v[0-9]')
HARMONY_FLAGS=""
if [[ ${NODE_VERSION:1:1} -le $MAX_HARMONY_VERSION ]]; then
echo "Running with harmony for select es6 support"
$HARMONY_FLAGS="--harmony --harmony_destructuring"
fi
# echo "Starting server"
node $HARMONY_FLAGS server.js
#!/bin/bash
# Set up Dart if it doesn't exist
if [ ! -f ~/dart-sdk/bin/dart ]; then
# Download if not already downloaded
if [ ! -f ~/dart.tar.gz ]; then
echo "Downloading Dart..."
curl -Lo ~/dart.tar.gz https://github.com/DanTup/Misc/releases/download/v1/dart-sdk.tar.gz
fi
# Extract
echo "Extracting Dart..."
tar xzf ~/dart.tar.gz -C ~
fi
echo "Launching Dart..."
~/dart-sdk/bin/dart ~/src/server.dart
I’m not sure exactly what’s different between mine and yours (nor do I know if this is intended to be supported), but the Dart sample still seems to work today
In my package.json, i just had ./script/start.sh, not bash script/start.sh. The former (sans bash) works in my local dev environment (and presumably in prod) but not on HyperDev. Looks like HyperDev wants to see bash.
All files in the editor are created with “read/write” permissions, but no “exec” permissions: it means that you cannot treat them as executables. However, you can pass them to an interpreter/executor, bash, in your case.