-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
54 lines (48 loc) · 1.27 KB
/
gulpfile.js
File metadata and controls
54 lines (48 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
var gulp = require("gulp"),
del = require("del"),
shell = require("gulp-shell"),
zip = require("gulp-zip"),
destinationFolder = "dist",
sourceFolder = "src",
projectName = "Test_Scripts",
projectVersion = "1.0.0";
// 0. Clean the whole dest/ folder
gulp.task("clean", function () {
return del([destinationFolder + "/**/*"]);
});
// 1. Copy the scripts from sourceFolder to destinationFolder
gulp.task("copy-scripts", function () {
return gulp
.src(sourceFolder + "/**/*.ms")
.pipe(gulp.dest(destinationFolder + "/"));
});
// 2. Encrypt scripts
gulp.task(
"encrypt-scripts",
shell.task("3dsmax -U MAXScript encryptScript.ms")
);
// 3. Zip .zxp and .pdf files
gulp.task("zip-project", () =>
gulp
.src([destinationFolder + "/" + "*.mse"])
.pipe(zip(projectName + "_v" + projectVersion + ".zip"))
.pipe(gulp.dest(destinationFolder))
);
// 4. Clean the whole dest/ folder
gulp.task("remove-old-scripts", function () {
return del([
destinationFolder + "/**/*.ms",
destinationFolder + "/**/*.mse",
]);
});
// Default task
gulp.task(
"default",
gulp.series(
"clean",
"copy-scripts",
"encrypt-scripts",
"zip-project",
"remove-old-scripts"
)
);