PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` let Task = require('./Task'); let FileCollection = require('../FileCollection'); let Log = require('../Log'); const path = require('path'); const File = require('../File'); /** * @extends {Task<{ from: string|string[], to: File }>} */ class CopyFilesTask extends Task { /** * Run the task. */ async run() { let copy = this.data; this.files = new FileCollection(copy.from); await this.files.copyTo(copy.to); this.assets = this.files.assets; } /** * Handle when a relevant source file is changed. * * @param {string} updatedFile */ async onChange(updatedFile) { let destination = this.data.to; // If we're copying a src directory recursively, we have to calculate // the correct destination path, based on the src directory tree. if (!Array.isArray(this.data.from) && new File(this.data.from).isDirectory()) { destination = destination.append( path.normalize(updatedFile).replace(path.normalize(this.data.from), '') ); } Log.feedback(`Copying ${updatedFile} to ${destination.path()}`); await this.files.copyTo(destination, new File(updatedFile)); } } module.exports = CopyFilesTask;