/* lib/terminal/commands/interface/copy - Shell interface for the file copy command. */ import copy from "../library/copy.js";
import error from "../../utilities/error.js";
import node from "../../utilities/node.js";
import vars from "../../utilities/vars.js";
const interfaceCopy = function terminal_commands_interface_copy(callback) {
    if (process.argv[0] === undefined || process.argv[1] === undefined) {
        error([
            "The copy command requires a source path and a destination path.",
            `Please execute ${vars.text.cyan + vars.terminal.command_instruction}commands copy${vars.text.none} for examples.`
        ], null);
        return;
    }
    const config = {
        callback: function terminal_commands_interface_copy_callback(title, text) {
            callback(title, text, null);
        },
        destination: node.path.resolve(process.argv[1]),
        exclusions: vars.terminal.exclusions,
        replace: process.argv.indexOf("replace") > -1,
        target: node.path.resolve(process.argv[0])
    };
    if (config.destination === "/") {
        config.destination = "/";
    } else {
        config.destination = config.destination + vars.path.sep;
    }
    copy(config);
};
export default interfaceCopy;
