Skip to content

Commit

Permalink
Prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
avoinea committed Nov 9, 2020
1 parent 7b54952 commit 5211fa0
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 18 deletions.
7 changes: 5 additions & 2 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{
"npm": {
"publish": false
},
"git": {
"changelog": "npx auto-changelog --stdout --commit-limit false -u --template https://raw.githubusercontent.com/release-it/release-it/master/templates/changelog-compact.hbs",
"tagName": "v${version}"
"tagName": "${version}"
},
"github": {
"release": true,
"releaseName": "${version}",
"releaseNotes": "npx auto-changelog --stdout --commit-limit false -u --template https://raw.githubusercontent.com/release-it/release-it/master/templates/changelog-compact.hbs"
},
"hooks": {
"before:init": "yarn test",
"before:init": "echo 'DISABLE: yarn test'",
"after:bump": "npx auto-changelog --commit-limit false -p"
}
}
38 changes: 30 additions & 8 deletions bootstrap
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
#!/bin/bash
TEMPLATE="volto-addon-template"
ADDON="$(basename $PWD)"

echo "Replacing $TEMPLATE with $ADDON"
grep -rlZ $TEMPLATE . --exclude="bootstrap" --exclude-dir=".git" | xargs -0 sed -i "s/$TEMPLATE/$ADDON/g"
echo "Done!"
echo "See git diff for details"
const path = require('path');
const fs = require('fs');

const currentDir = path.basename(process.cwd());

const bootstrap = function (ofile) {
fs.readFile(ofile, 'utf8', function (err, data) {
if (err) {
return console.log(err);
}
var result = data.replace(/volto-addon-template/g, currentDir);

fs.writeFile(ofile, result, 'utf8', function (err) {
if (err) {
return console.log(err);
}
});
});
}

fs.readdir(".", { withFileTypes: true }, (err, dirents) => {
const files = dirents
.filter(dirent => dirent.isFile())
.map(dirent => dirent.name);
files.forEach(function (file) {
if (file != 'bootstrap.js') {
bootstrap(file);
}
});
});
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
{
"name": "@eeacms/volto-group-block",
"version": "0.1.0",
"version": "0.1.2",
"description": "volto-group-block: Volto block to be used to group other blocks",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
"license": "MIT",
"devDependencies": {
"release-it": "*"
},
"scripts": {
"release": "release-it",
"bootstrap": "node bootstrap"
},
"homepage": "https://github.com/eea/volto-group-block",
"keywords": [
"volto-addon",
Expand All @@ -17,12 +24,5 @@
"repository": {
"type": "git",
"url": "git@github.com:eea/volto-group-block.git"
},
"devDependencies": {
"release-it": "*"
},
"scripts": {
"release": "release-it",
"bootstrap": "./bootstrap"
}
}

0 comments on commit 5211fa0

Please sign in to comment.