diff --git a/.gitignore b/.gitignore index 1100482..b9a4c81 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ include/boost/* *.gch dist/8 dist/* +/bitmap2component diff --git a/README.md b/README.md index ea9e110..44b1948 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ Download and open [Example PCB](https://raw.githubusercontent.com/badgeek/svg2sh - [KitSprint ANORG 2018](http://wiki.sgmk-ssam.ch/wiki/KitSprint_ANORG_2018#Kicad_bitmap_import_for_Shenzhen_Ready) ## Videos + - Drawing PCBs with Inkscape (FOSSDEM) with @kasbah of kitspace - https://www.youtube.com/watch?v=xXRPw7ItMaM - Making a PCB Badge for Hackaday Supercon! - https://www.youtube.com/watch?v=YqdBiOj8uXw - Understanding and Making PCB Art (mrtwinkletwinkle) https://www.youtube.com/watch?v=Sbkvza8cKQE @@ -90,18 +91,20 @@ This project is developed independently and without any connection to funding or Donation is highly appreciated. Go to to become a patron and support this project - - - +[![](https://i.imgur.com/ys5X3ZP.png)](https://www.patreon.com/badgeek) ## Contributors -- Budi Prakosa [@badgeek](https://github.com/badgeek) -- Kaspar Emanuel [@kasbah](https://github.com/kasbah) +- Budi Prakosa [\@badgeek](https://github.com/badgeek) +- Kaspar Emanuel [\@kasbah](https://github.com/kasbah) ## Credits -* inkscape-export-layers - -* bitmap2component (kicad) - -* csv_output - -* svg2mod - +* inkscape-export-layers - + +* bitmap2component (KiCad) - + +* csv_output - + +* svg2mod - + diff --git a/build.sh b/build.sh index 1010c95..caee25b 100644 --- a/build.sh +++ b/build.sh @@ -1,31 +1,56 @@ -#!/bin/bash - -cwd=$(pwd) +#!/usr/bin/env bash +# Creates distribution archives. +# Requires the binaries be already built (with make) +# and moved to the stageing area. + +# Exit immediately on each error and unset variable; +# see: https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ +#set -Eeuo pipefail +set -Eeu + +argv0=$(echo "$0" | sed -e 's,\\,/,g') +script_dir=$(dirname "$(readlink "$0" || echo "$argv0")") +case "$(uname -s)" in + *CYGWIN*) + script_dir=$(cygpath -w "$script_dir") + ;; + Linux) + script_dir=$(dirname "$(readlink -f "$0" || echo "$argv0")") + ;; +esac +script_dir_abs="$(cd "$script_dir"; pwd)" +# shellcheck source=./ +root="$script_dir_abs" +cwd="$(pwd)" BUILD_DIR=dist BUILD_DIR_STAGING=staging -GIT_TAG_VERSION=`git describe --tag` +GIT_TAG_VERSION="$(git describe --tag)" RELEASE_FILENAME_PREFIX=svg2shenzhen-extension -# echo "$cwd/$BUILD_DIR/$BUILD_DIR_STAGING" +# echo "$root/$BUILD_DIR/$BUILD_DIR_STAGING" +RELEASE_FILENAME_BASE="${root:?}/$BUILD_DIR/${RELEASE_FILENAME_PREFIX}-${GIT_TAG_VERSION}" -rm -fr $cwd/$BUILD_DIR/* +rm -fr "${root:?}/$BUILD_DIR/"* -mkdir -p "$cwd/$BUILD_DIR/$BUILD_DIR_STAGING" +mkdir -p "${root:?}/$BUILD_DIR/$BUILD_DIR_STAGING" -cp -r inkscape/* $cwd/$BUILD_DIR/$BUILD_DIR_STAGING +cp -r "${root:?}/inkscape/"* "${root:?}/$BUILD_DIR/$BUILD_DIR_STAGING" -find $cwd/$BUILD_DIR/$BUILD_DIR_STAGING -name *.inx -type f -exec sed -i.bak s/SVGSZ_VER/${GIT_TAG_VERSION}/g '{}' \; +find "${root:?}/$BUILD_DIR/$BUILD_DIR_STAGING" \ + -name "*.inx" \ + -type f \ + -exec sed -i.bak "s/SVGSZ_VER/${GIT_TAG_VERSION}/g" '{}' \; -rm -fr $cwd/$BUILD_DIR/$BUILD_DIR_STAGING/*.bak +rm -fr "${root:?}/$BUILD_DIR/$BUILD_DIR_STAGING/"*.bak -cd $cwd/$BUILD_DIR/$BUILD_DIR_STAGING +cd "${root:?}/$BUILD_DIR/$BUILD_DIR_STAGING" -tar -czvf $cwd/$BUILD_DIR/${RELEASE_FILENAME_PREFIX}-${GIT_TAG_VERSION}.tar.gz . -zip -m -x .DS_Store -r $cwd/$BUILD_DIR/${RELEASE_FILENAME_PREFIX}-${GIT_TAG_VERSION}.zip . +tar -czvf "${RELEASE_FILENAME_BASE}.tar.gz" . +zip -m -x .DS_Store -r "${RELEASE_FILENAME_BASE}.zip" . -cd $cwd +cd "$cwd" -ls dist \ No newline at end of file +ls "$BUILD_DIR"