It would be immensely useful to have a counterpart to setupShellInitFile(), something like cleanupShellInitFile().
That would allow to run setupShellInitFile() in an npm postinstall hook. Doing this right now will append another completion block to the shell init file each time npm i -g cli-package is run (e.g. to update the CLI).
cleanupShellInitFile() could be used in a postuninstall hook to make sure there will never be more than one completion block.
It would be immensely useful to have a counterpart to
setupShellInitFile(), something likecleanupShellInitFile().That would allow to run
setupShellInitFile()in an npmpostinstallhook. Doing this right now will append another completion block to the shell init file each timenpm i -g cli-packageis run (e.g. to update the CLI).cleanupShellInitFile()could be used in apostuninstallhook to make sure there will never be more than one completion block.