diff --git a/setup.py b/setup.py index 90bcaef..1a479cd 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ def main(): long_description='SSH connection and aliases manager with curses and command line interface', long_description_content_type='text/x-rst', license='DWTWL 2.55', - version='1.03', + version='1.04', py_modules=['sshch'], scripts=['sshch/sshch'], keywords='sshch ssh aliases curses manager', diff --git a/sshch/sshch b/sshch/sshch index c87b9f7..2120471 100755 --- a/sshch/sshch +++ b/sshch/sshch @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division @@ -20,11 +20,12 @@ import curses from curses import textpad, panel # https://gitlab.com/zlax/sshch -version = "1.03" -# path to conf file, default: ~/.config/sshch.conf -conf_file = path.expanduser("~") + '/.config/sshch.conf' +version = "1.04" # expand groups by default expand_default = True +# path to conf dir and file, default: ~/.config/sshch.conf +conf_dir = path.expanduser("~") + '/.config' +conf_file = conf_dir + '/' + 'sshch.conf' def AddNewAlias(alias): @@ -806,6 +807,10 @@ if __name__ == "__main__": except NameError: pass + if not path.exists(conf_dir): + from os import makedirs + makedirs(conf_dir) + conf = configparser.RawConfigParser() if not path.exists(conf_file): open(conf_file, 'w')