Last active
January 27, 2019 14:18
-
-
Save MarcoNicolodi/cf82540c38b0e7b18b0c2aabb3f8f304 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const chooseFile = async ({ directory, message }) => { | |
const candidateFiles = await filesystem.list(directory) | |
const promptConfig = { | |
name: 'chosenFile', | |
message, | |
choices: ['all', prompt.separator(), ...candidateFiles] | |
} | |
const { chosenFile } = await prompt.ask(promptConfig) | |
return chosenFile | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment