forked from dachan/dach
1
0
Fork 0
dach/node_modules/jake/lib/task/directory_task.js

31 lines
575 B
JavaScript
Raw Normal View History

2023-10-22 22:39:45 +03:00
let fs = require('fs');
let FileTask = require('./file_task').FileTask;
/**
@name jake
@namespace jake
*/
/**
@name jake.DirectoryTask
@constructor
@augments EventEmitter
@augments jake.Task
@augments jake.FileTask
@description A Jake DirectoryTask
@param {String} name The name of the directory to create.
*/
class DirectoryTask extends FileTask {
constructor(...args) {
super(...args);
if (fs.existsSync(this.name)) {
this.updateModTime();
}
else {
this.modTime = null;
}
}
}
exports.DirectoryTask = DirectoryTask;