Skip to content

Commit

Permalink
Refactored build script to pull license-list from git
Browse files Browse the repository at this point in the history
Signed-off-by: Alan D. Tse <alandtse@gmail.com>
  • Loading branch information
alandtse committed Apr 19, 2018
1 parent d2ac027 commit e3a1032
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ npm-debug.log

dist/
packages/
license-list/
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "license-list"]
path = license-list
url = https://github.com/spdx/license-list-data
1 change: 0 additions & 1 deletion license-list
Submodule license-list deleted from 828b41
29 changes: 22 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"chromereload": "0.x.x",
"debounce": "1.x.x",
"del": "3.x.x",
"directory-exists": "^2.0.0",
"gulp": "3.x.x",
"gulp-bump": "2.x.x",
"gulp-cache": "0.x.x",
Expand Down
21 changes: 20 additions & 1 deletion tasks/license-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,27 @@ import livereload from 'gulp-livereload'
import args from './lib/args'
var fs = require('fs');
var exec = require('child_process').exec;
var git = require('gulp-git');
const directoryExists = require('directory-exists');

gulp.task('license-list', () => {
gulp.task('get-list', () => {
if (directoryExists.sync('./license-list')){
process.chdir('license-list')
git.pull('origin', 'master', function (err) {
if (err) throw err;
});
process.chdir('..')
}
else{
git.clone('https://github.com/spdx/license-list-data', {args: './license-list'}, function (err) {
if (err) throw err;
});
}
return
})


gulp.task('license-list', ['get-list'],() => {
process.chdir('license-list/text')
exec('ls *.txt > ../spdx.txt', function (err, stdout, stderr) {
console.log(stdout);
Expand Down

0 comments on commit e3a1032

Please # to comment.