def swap(version_spec=None): if version_spec != None: log('Swapping node version to ~' + version_spec) else: print('\n\nSwap current node version') version_spec = get_input( 'Enter the version of node you\'d like to swap to ~', vald_pch) do_ext('nodist ' + version_spec) log('Swapped node version ~' + version_spec)
def m_input(): print('\n\n\nCurrent versions of node installed:') do_ext('nodist ls') u_in = get_input( '\n\n\nSelect: \n\t(s)wap node version\n\t(i)nstall node version\n\t(u)ninstall node version ~', vald_in_opt) if (u_in == 's'): swap() elif (u_in == 'i'): install() elif (u_in == 'u'): uninstall()
def main(): print('\n\n\nWelcome to nocha v' + VERSION_NUMBER) test_dep() pkg = 'package.json' PACKAGE_JSON_EXISTS = m_find_json(pkg) skip_m_in = False if PACKAGE_JSON_EXISTS: skip_m_in = read_pkg(pkg) if not skip_m_in: m_input() print('\nnocha completed...') u_in = get_input('Start nocha again? (y)es/(n)o ~', vald_y_n) if (u_in == 'y'): m_input()
def install(): print('\n\nInstall new node version') u_in = get_input('Enter the version of node you\'d like to install ~', vald_pch) do_ext('nodist + ' + u_in) log('Installed node version ~' + u_in)
def uninstall(): print('\n\nInstall new node version') u_in = get_input('Enter the version of node you\'d like to remove ~', vald_pch) do_ext('nodist - ' + u_in) log('Uninstalled node version ~' + u_in)