From 654389db932b693b5543644fcfc5421625d6a234 Mon Sep 17 00:00:00 2001 From: Garth Minette Date: Sat, 6 Feb 2021 22:36:16 -0800 Subject: [PATCH] Added INCH=25.4 constant. --- constants.scad | 6 ++++++ githooks/pre-merge-commit | 17 ----------------- .../pre-commit => scripts/increment_version.sh | 1 + 3 files changed, 7 insertions(+), 17 deletions(-) delete mode 100755 githooks/pre-merge-commit rename githooks/pre-commit => scripts/increment_version.sh (92%) diff --git a/constants.scad b/constants.scad index 3444981..cfad4bc 100644 --- a/constants.scad +++ b/constants.scad @@ -15,6 +15,12 @@ $slop = 0.20; +// Constant: INCH +// Description: +// The number of millimeters in an inch. +INCH = 25.4; + + // Section: Directional Vectors // Vectors useful for `rotate()`, `mirror()`, and `anchor` arguments for `cuboid()`, `cyl()`, etc. diff --git a/githooks/pre-merge-commit b/githooks/pre-merge-commit deleted file mode 100755 index 28c0139..0000000 --- a/githooks/pre-merge-commit +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -VERFILE="version.scad" - -vernums=$(grep ^BOSL_VERSION "$VERFILE" | sed 's/^.*[[]\([0-9,]*\)[]].*$/\1/') -major=$(echo "$vernums" | awk -F, '{print $1}') -minor=$(echo "$vernums" | awk -F, '{print $2}') -revision=$(echo "$vernums" | awk -F, '{print $3}') - -newrev=$(($revision+1)) -echo "Current Version: $major.$minor.$revision" -echo "New Version: $major.$minor.$newrev" - -sed -i '' 's/^BOSL_VERSION = .*$/BOSL_VERSION = ['"$major,$minor,$newrev];/g" $VERFILE - -exec git add version.scad - diff --git a/githooks/pre-commit b/scripts/increment_version.sh similarity index 92% rename from githooks/pre-commit rename to scripts/increment_version.sh index 28c0139..62f06f9 100755 --- a/githooks/pre-commit +++ b/scripts/increment_version.sh @@ -14,4 +14,5 @@ echo "New Version: $major.$minor.$newrev" sed -i '' 's/^BOSL_VERSION = .*$/BOSL_VERSION = ['"$major,$minor,$newrev];/g" $VERFILE exec git add version.scad +exec git commit -m "Bump minor version."