mirror of
https://github.com/Mibew/mibew-operator-status-plugin.git
synced 2025-01-22 10:00:30 +03:00
add gulp support, fix #6
This commit is contained in:
parent
66ee83b0b0
commit
3025f9e3cc
7
.gitignore
vendored
7
.gitignore
vendored
@ -1,2 +1,5 @@
|
|||||||
*.zip
|
# Do not index node.js modules that are used for building
|
||||||
*.gz
|
node_modules
|
||||||
|
|
||||||
|
# Do not index releases
|
||||||
|
release
|
22
build.sh
22
build.sh
@ -1,22 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
author='Mibew'
|
|
||||||
|
|
||||||
tmp_dir='/tmp'
|
|
||||||
working_dir=`echo $PWD`
|
|
||||||
|
|
||||||
target_dir="$tmp_dir/$author/Mibew/Plugin/OperatorStatus"
|
|
||||||
mkdir -p $target_dir
|
|
||||||
|
|
||||||
shopt -s extglob
|
|
||||||
cp -R !(*.sh) $target_dir
|
|
||||||
shopt -u extglob
|
|
||||||
|
|
||||||
version=`cat Plugin.php|grep -Po "(?<=return ')(\d.){2}\d{1}"`
|
|
||||||
|
|
||||||
cd $tmp_dir
|
|
||||||
|
|
||||||
tar -czvf $working_dir/mibew-operator-status-plugin.$version.tar.gz $author
|
|
||||||
zip -r $working_dir/mibew-operator-status-plugin.$version.zip $author
|
|
||||||
|
|
||||||
rm -rf $plugin_root_dir
|
|
@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "Mibew/mibew-operator-status-plugin",
|
|
||||||
"description": "An operator status plugin for Mibew 2.0.",
|
|
||||||
"license": "MIT",
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "everyx",
|
|
||||||
"email": "lunt.luo@gmail.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"autoload": {
|
|
||||||
"psr-0": {"Mibew\\Mibew\\Plugin\\OperatorStatus\\": ""}
|
|
||||||
},
|
|
||||||
"target-dir": "Mibew/Mibew/Plugin/OperatorStatus"
|
|
||||||
}
|
|
46
gulpfile.js
Normal file
46
gulpfile.js
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
var eventStream = require('event-stream'),
|
||||||
|
gulp = require('gulp'),
|
||||||
|
chmod = require('gulp-chmod'),
|
||||||
|
zip = require('gulp-zip'),
|
||||||
|
tar = require('gulp-tar'),
|
||||||
|
gzip = require('gulp-gzip'),
|
||||||
|
rename = require('gulp-rename');
|
||||||
|
|
||||||
|
gulp.task('prepare-release', function() {
|
||||||
|
var version = require('./package.json').version;
|
||||||
|
|
||||||
|
return eventStream.merge(
|
||||||
|
getSources()
|
||||||
|
.pipe(zip('mibew-operator-status-plugin-' + version + '.zip')),
|
||||||
|
getSources()
|
||||||
|
.pipe(tar('mibew-operator-status-plugin-' + version + '.tar'))
|
||||||
|
.pipe(gzip())
|
||||||
|
)
|
||||||
|
.pipe(chmod(0644))
|
||||||
|
.pipe(gulp.dest('release'));
|
||||||
|
});
|
||||||
|
|
||||||
|
// Builds and packs plugins sources
|
||||||
|
gulp.task('default', ['prepare-release'], function() {
|
||||||
|
// The "default" task is just an alias for "prepare-release" task.
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns files stream with the plugin sources.
|
||||||
|
*
|
||||||
|
* @returns {Object} Stream with VinylFS files.
|
||||||
|
*/
|
||||||
|
var getSources = function() {
|
||||||
|
return gulp.src([
|
||||||
|
'Controller/*',
|
||||||
|
'LICENSE',
|
||||||
|
'Plugin.php',
|
||||||
|
'README.md',
|
||||||
|
'routing.yml'
|
||||||
|
],
|
||||||
|
{base: './'}
|
||||||
|
)
|
||||||
|
.pipe(rename(function(path) {
|
||||||
|
path.dirname = 'Mibew/Mibew/Plugin/OperatorStatus/' + path.dirname;
|
||||||
|
}));
|
||||||
|
}
|
12
package.json
Normal file
12
package.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"version": "0.3.0",
|
||||||
|
"devDependencies": {
|
||||||
|
"event-stream": "~3.3.1",
|
||||||
|
"gulp": "^3.9.1",
|
||||||
|
"gulp-chmod": "~1.2.0",
|
||||||
|
"gulp-gzip": "~1.1.0",
|
||||||
|
"gulp-rename": "~1.2.2",
|
||||||
|
"gulp-tar": "~1.4.0",
|
||||||
|
"gulp-zip": "~3.0.2"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user