polaris-cli-tool
Version:
Polaris CLI - Modern Development Workspace Manager for Distributed Compute Resources
28 lines (27 loc) • 842 B
JavaScript
async function getFilePath() {
console.log('\n' + boxen(
chalk.cyan.bold('📥 How to add your Excel file:') + '\n\n' +
chalk.white('1. ') + chalk.yellow('Drag and drop') + chalk.white(' your Excel file here') + '\n' +
chalk.white('2. Or paste the full ') + chalk.yellow('file path'),
{
padding: 1,
margin: 1,
borderStyle: 'round',
borderColor: 'blue'
}
));
return inquirer.prompt([
{
type: 'input',
name: 'filePath',
message: chalk.cyan('📂 Drag file here or enter path:'),
prefix: '→',
validate: (input) => {
if (fs.existsSync(input) && input.endsWith('.xlsx')) {
return true;
}
return chalk.red('Please provide a valid Excel file (.xlsx)');
}
}
]);
}