Skip to content

Commit

Permalink
Merge pull request #11 from masterchief01/develop
Browse files Browse the repository at this point in the history
setup gulp task to empty the uploads directory before every test run …
  • Loading branch information
pranjalwalia authored Feb 12, 2021
2 parents 89f54d8 + 591965d commit 1a3ef0b
Show file tree
Hide file tree
Showing 8 changed files with 1,564 additions and 36 deletions.
5 changes: 5 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const gulp = require('gulp');
const requireDir = require('require-dir');
requireDir('./tasks', { recurse: true });

gulp.task('dev:pipeline', gulp.series('dev:cleanup'));
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"build": "yarn clean && prettier --write src/ && tsc",
"clean": "rm -rf dist",
"test": "jest",
"lint": "eslint src/*.js"
"lint": "eslint src/*.js",
"bundle:prod": "yarn build && webpack",
"bundle:dev": "yarn build && webpack"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -50,11 +52,15 @@
"@types/uuid": "^8.3.0",
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"del": "^6.0.0",
"eslint": "^7.19.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.22.1",
"gulp": "^4.0.2",
"gulp-run": "^1.7.1",
"jest": "^26.6.3",
"nodemon": "^2.0.7",
"require-dir": "^1.2.0",
"ts-node": "^9.1.1",
"typescript": "^4.1.3"
}
Expand Down
10 changes: 10 additions & 0 deletions tasks/Cleanup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const gulp = require('gulp');
const del = require('del');

const cleanup = (cb) => {
del('uploads/**', { force: true });
cb();
};

gulp.task('dev:cleanup', cleanup);
module.exports = cleanup;
9 changes: 9 additions & 0 deletions tasks/Default.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const gulp = require('gulp');

const defaultTask = (cb) => {
console.log('Running the Default Task!');
cb();
};

gulp.task('default', defaultTask);
module.exports = defaultTask;
11 changes: 11 additions & 0 deletions tasks/DevPipeline.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const gulp = require('gulp');
const run = require('gulp-run');
const { exec } = require('child_process');

const rundev = (cb) => {
run('yarn dev').exec();
cb();
};

gulp.task('dev', rundev);
module.exports = rundev;
Binary file removed uploads/1612635600932-3391688.jpg
Binary file not shown.
Empty file added webpack.config.js
Empty file.
Loading

0 comments on commit 1a3ef0b

Please sign in to comment.