diff --git a/.gitignore b/.gitignore index 64cba886..7b4c1bf3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # Logs -logs +/logs *.log npm-debug.log* @@ -9,10 +9,10 @@ pids *.seed # Directory for instrumented libs generated by jscoverage/JSCover -lib-cov +/lib-cov # Coverage directory used by tools like istanbul -coverage +/coverage # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt @@ -21,15 +21,14 @@ coverage .lock-wscript # Compiled binary addons (http://nodejs.org/api/addons.html) -build +/build # Dependency directory # https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git node_modules -bower_components -# Compiled Electron releases -dist +# Compiled Etcher releases +/dist # Certificates *.spc diff --git a/scripts/build/target-convert.sh b/scripts/build/target-convert.sh new file mode 100755 index 00000000..90d3d939 --- /dev/null +++ b/scripts/build/target-convert.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +### +# Copyright 2017 resin.io +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +### + +set -e +set -u + +function usage() { + echo "Usage: $0" + echo "" + echo "Options" + echo "" + echo " -r " + echo " -t " + exit 1 +} + +ARGV_TARGET="" +ARGV_TYPE="" + +while getopts ":r:t:" option; do + case $option in + r) ARGV_TARGET=$OPTARG ;; + t) ARGV_TYPE=$OPTARG ;; + *) usage ;; + esac +done + +if [ -z "$ARGV_TARGET" ] || [ -z "$ARGV_TYPE" ]; then + usage +fi + +RESULT="" + +if [ "$ARGV_TYPE" == "pkg" ]; then + if [ "$ARGV_TARGET" == "linux" ]; then + RESULT=linux + elif [ "$ARGV_ARCHITECTURE" == "win32" ]; then + RESULT=win + elif [ "$ARGV_ARCHITECTURE" == "darwin" ]; then + RESULT=macos + fi +else + echo "Unsupported target type: $ARGV_TYPE" 1>&2 + exit 1 +fi + +if [ -z "$RESULT" ]; then + echo "Unsupported target: $ARGV_TARGET" 1>&2 + exit 1 +fi + +echo "$RESULT"