diff --git a/lib/constants.js b/lib/constants.js index 0935375..0334d1f 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -18,13 +18,6 @@ const COMPLETION_FILE_EXT = { zsh: 'zsh', }; -const TABTAB_FILE_NAME = { - bash: '__tabtab.bash', - fish: '__tabtab.fish', - pwsh: '__tabtab.ps1', - zsh: '__tabtab.zsh', -}; - module.exports = { BASH_LOCATION, ZSH_LOCATION, @@ -33,5 +26,4 @@ module.exports = { COMPLETION_DIR, SHELL_LOCATIONS, COMPLETION_FILE_EXT, - TABTAB_FILE_NAME, }; diff --git a/lib/filename.js b/lib/filename.js index 1ce3507..91d18cc 100644 --- a/lib/filename.js +++ b/lib/filename.js @@ -1,4 +1,4 @@ -const { COMPLETION_FILE_EXT, TABTAB_FILE_NAME } = require('./constants'); +const { COMPLETION_FILE_EXT } = require('./constants'); /** * Get a template file name for the SHELL provided. @@ -33,11 +33,11 @@ const completionFileName = (name, shell = systemShell()) => { * @returns {String} */ const tabtabFileName = (shell = systemShell()) => { - const filename = TABTAB_FILE_NAME[shell]; - if (!filename) { + const ext = COMPLETION_FILE_EXT[shell]; + if (!ext) { throw new Error(`Unsupported shell: ${shell}`); } - return filename; + return `__tabtab.${ext}`; }; module.exports = {