You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
683 B
24 lines
683 B
10 years ago
|
"use strict";
|
||
|
|
||
7 years ago
|
import path = require("path");
|
||
|
import fse = require("fs-extra");
|
||
10 years ago
|
|
||
7 years ago
|
export = (params, processor) => ({
|
||
7 years ago
|
"process": () => {
|
||
|
const sourceFilePath = path.join(processor.context.exported, params.filename);
|
||
|
const targetFilePath = path.join(processor.context.release, params.filename);
|
||
10 years ago
|
|
||
7 years ago
|
processor.onInfo(`Copying ${sourceFilePath} to ${targetFilePath}`);
|
||
10 years ago
|
|
||
8 years ago
|
fse.copy(sourceFilePath, targetFilePath, (err) => {
|
||
|
if (err) {
|
||
7 years ago
|
processor.onError(`Unable to copy file: ${err}`);
|
||
8 years ago
|
} else {
|
||
|
processor.onInfo("Copied file");
|
||
|
}
|
||
7 years ago
|
|
||
8 years ago
|
return processor.done();
|
||
|
});
|
||
|
}
|
||
8 years ago
|
});
|