diff --git a/Makefile b/Makefile index fbb641c..435b77f 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,2 @@ package: - (cd src && zip -r - . -x '*.swp' -x '*.DS_Store') > marinara-`jq -r .version src/manifest.json`.zip + ruby make.rb diff --git a/make.rb b/make.rb new file mode 100644 index 0000000..d604214 --- /dev/null +++ b/make.rb @@ -0,0 +1,13 @@ +unversioned = `git ls-files -o src`.strip +if !unversioned.empty? + puts "Error: Unversioned files in tree, exiting.\n#{unversioned}" + exit 1 +end + +version = `jq -r .version src/manifest.json`.strip +if version.empty? + puts 'Error: Package version not found in manifest.json, exiting.' + exit 1 +end + +`(cd src && zip -r - . -x '*.swp' -x '*.DS_Store') > marinara-#{version}.zip`