Publish script.

This commit is contained in:
baldo 2016-06-11 19:08:46 +02:00
parent 697ad50f1d
commit 3fb3eb437f
3 changed files with 50 additions and 2 deletions

View file

@ -370,7 +370,6 @@ module.exports = function (grunt) {
dest: '<%= yeoman.dist %>/',
src: [
'config.json.example',
'package.json',
'LICENSE',
'README.md'
]
@ -397,6 +396,23 @@ module.exports = function (grunt) {
}
},
// Toggle private flag in package.json when copying to dist/.
replace: {
dist: {
options: {
patterns: [{
match: /"private": true/g,
replacement: '"private": false'
}]
},
files: [{
src: ['package.json'],
dest: 'dist/',
cwd: '.'
}]
}
},
// Run some tasks in parallel to speed up the build process
concurrent: {
server: [
@ -442,6 +458,7 @@ module.exports = function (grunt) {
'concat',
'ngAnnotate',
'copy:dist',
'replace:dist',
'cssmin',
'uglify',
'rev',

View file

@ -1,9 +1,11 @@
{
"name": "ffffng",
"version": "0.2.0-SNAPSHOT",
"description": "Node managent form for Freifunk",
"description": "Node management form for Freifunk",
"license": "MIT",
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/freifunkhamburg/ffffng"
@ -41,6 +43,9 @@
"sqlite3": "3.1.4"
},
"devDependencies": {
"bower": "1.7.9",
"grunt-cli": "1.2.0",
"escape-string-regexp": "1.0.5",
"grunt": "~0.4.1",
"grunt-autoprefixer": "~3.0.4",
@ -61,6 +66,7 @@
"grunt-html2js": "~0.3.6",
"grunt-newer": "~1.2.0",
"grunt-ng-annotate": "~2.0.2",
"grunt-replace": "~1.0.1",
"grunt-rev": "~0.1.0",
"grunt-svgmin": "~3.2.0",
"grunt-usemin": "~3.1.1",

25
publish.sh Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -e
cd $(dirname $0)
version=$(grep '^ *"version": *"[^"]*" *, *$' package.json | cut -d '"' -f4)
if [ -z "$version" ]; then
echo "Could not determine current version."
exit 1
fi
echo "Current version: $version"
if [[ $version =~ 'SNAPSHOT' ]]; then
echo "Will not publish SNAPSHOT version."
exit 1
fi
./node_modules/.bin/grunt clean build
cd dist
npm publish