@saiforceone/dirt-cli
Version:
Official CLI Utility for the D.I.R.T stack
18 lines • 859 B
JavaScript
import { existsSync } from 'node:fs';
import { standardOutputBuilder } from '../../utils/standardOutputBuilder.js';
/**
* @description Given the project destination (directory path), checks if it already exists
* @param {string} destination - the destination of the project
*/
export function checkDestinationExistence(destination) {
const output = standardOutputBuilder();
const destinationExists = existsSync(destination);
if (destinationExists)
output.error = `Project destination path: [${destination}] already exists.\nYou may need to remove the corresponding virtual environment if it exists`;
output.result = destinationExists
? 'Project destination already exists'
: 'Project can be created at destination';
output.success = destinationExists;
return output;
}
//# sourceMappingURL=coreHelpers.js.map