mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-11 10:06:35 +02:00
Version 4.0.0
This commit is contained in:
parent
8149db8436
commit
62bfde18bc
|
@ -24,7 +24,7 @@
|
||||||
"css:sass": "node-sass --output-style expanded --include-path scss src/styles/base.scss public/assets/styles/base.css && node-sass --output-style expanded --include-path scss src/styles/choices.scss public/assets/styles/choices.css",
|
"css:sass": "node-sass --output-style expanded --include-path scss src/styles/base.scss public/assets/styles/base.css && node-sass --output-style expanded --include-path scss src/styles/choices.scss public/assets/styles/choices.css",
|
||||||
"css:prefix": "postcss --use autoprefixer -b 'last 2 versions' public/assets/styles/*.css -d public/assets/styles",
|
"css:prefix": "postcss --use autoprefixer -b 'last 2 versions' public/assets/styles/*.css -d public/assets/styles",
|
||||||
"css:min": "csso public/assets/styles/base.css public/assets/styles/base.min.css && csso public/assets/styles/choices.css public/assets/styles/choices.min.css",
|
"css:min": "csso public/assets/styles/base.css public/assets/styles/base.min.css && csso public/assets/styles/choices.css public/assets/styles/choices.min.css",
|
||||||
"version": "node version.js --current $npm_package_version --new $npm_config_newVersion",
|
"version": "node version.js --current $npm_package_version",
|
||||||
"postversion": "npm run js:build",
|
"postversion": "npm run js:build",
|
||||||
"prepush": "run-p lint test:unit"
|
"prepush": "run-p lint test:unit"
|
||||||
},
|
},
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
2
public/assets/scripts/choices.min.js
vendored
2
public/assets/scripts/choices.min.js
vendored
File diff suppressed because one or more lines are too long
19
version.js
19
version.js
|
@ -2,8 +2,9 @@
|
||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
files: ['bower.json', 'package.json', 'index.html', 'version.js']
|
files: ['package.json', 'public/index.html', 'version.js'],
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -14,15 +15,15 @@ const argvToObject = () => {
|
||||||
const args = {};
|
const args = {};
|
||||||
let arg = null;
|
let arg = null;
|
||||||
process.argv.forEach((val, index) => {
|
process.argv.forEach((val, index) => {
|
||||||
if(/^--/.test(val)) {
|
if (/^--/.test(val)) {
|
||||||
arg = {
|
arg = {
|
||||||
index: index,
|
index,
|
||||||
name: val.replace(/^--/, '')
|
name: val.replace(/^--/, ''),
|
||||||
}
|
};
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(arg && ((arg.index+1 === index ))) {
|
if (arg && arg.index + 1 === index) {
|
||||||
args[arg.name] = val;
|
args[arg.name] = val;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -34,14 +35,14 @@ const argvToObject = () => {
|
||||||
* Loop through files updating the current version
|
* Loop through files updating the current version
|
||||||
* @param {Object} config
|
* @param {Object} config
|
||||||
*/
|
*/
|
||||||
const updateVersion = (config) => {
|
const updateVersion = ({ files }) => {
|
||||||
const args = argvToObject();
|
const args = argvToObject();
|
||||||
const currentVersion = args.current;
|
const currentVersion = args.current;
|
||||||
const newVersion = args.new;
|
const newVersion = args.new || currentVersion;
|
||||||
|
|
||||||
console.log(`Updating version from ${currentVersion} to ${newVersion}`);
|
console.log(`Updating version from ${currentVersion} to ${newVersion}`);
|
||||||
|
|
||||||
config.files.forEach((file) => {
|
files.forEach(file => {
|
||||||
const filePath = path.join(__dirname, file);
|
const filePath = path.join(__dirname, file);
|
||||||
const regex = new RegExp(currentVersion, 'g');
|
const regex = new RegExp(currentVersion, 'g');
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue