From 79aa3c4a7b026eae72ef5d8362d79464f15c0c9c Mon Sep 17 00:00:00 2001 From: Cooper Dalrymple Date: Wed, 29 Oct 2025 13:53:16 -0500 Subject: [PATCH] Add files into subdirectory of package --- .gitignore | 1 + gulpfile.js | 28 ++++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c332d61..33e9058 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ vendor node_modules *.zip +ogre-suspension diff --git a/gulpfile.js b/gulpfile.js index d18c1ab..c83599c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -16,7 +16,10 @@ const NAME = path.basename(__dirname); // Clean Tasks gulp.task('clean-package', () => { - return gulp.src(`${NAME}.zip`, { + return gulp.src([ + `${NAME}.zip`, + `${NAME}` + ], { read: false, allowEmpty: true, }).pipe(clean()); @@ -31,7 +34,7 @@ gulp.task( // Package Tasks -gulp.task('package', () => { +gulp.task('package-copy', () => { return gulp.src([ 'assets/**/*', 'inc/**/*', @@ -46,10 +49,31 @@ gulp.task('package', () => { allowEmpty: true }) .pipe(filter((file) => !file.path.includes('/node_modules'))) + .pipe(gulp.dest(`./${NAME}/`)); +}); + +gulp.task('package-zip', () => { + return gulp.src(`${NAME}/**/*`, { base: './' }) .pipe(zip(`${NAME}.zip`)) .pipe(gulp.dest('./')); }); +gulp.task('package-clean', () => { + return gulp.src(`${NAME}`, { + read: false, + allowEmpty: true, + }).pipe(clean()); +}); + +gulp.task( + 'package', + gulp.series( + 'package-copy', + 'package-zip', + 'package-clean' + ) +); + // Default Tasks gulp.task(