This commit is contained in:
glmdev 2018-11-28 14:37:28 -06:00
parent 8ae574a136
commit d94f945a6a
2 changed files with 5 additions and 6 deletions

View File

@ -14,7 +14,6 @@ This project is currently a work-in-progress. Only the fish shell is supported a
## TODO
- Documentation/License
- Installation & Generalization
- Zsh Support
- Command Memory/Env Support
- Double wh does an la, not ls
- Git Repo detection for ls

View File

@ -14,7 +14,7 @@ list_directory="ls --color=auto"
def set_runtime_var(name, value, options=""):
if ( shell == "fish" ):
print("set "+name+" "+options+" \""+value+"\"")
elif ( shell == "bash" || shell == "zsh" ):
elif ( shell == "bash" or shell == "zsh" ):
print("export "+name+"="+"\""+value+"\"")
def is_binary_file(filepathname):
@ -38,10 +38,10 @@ def file_len(fname):
# bootstrap the config
ENV_HOME=os.environ['HOME']
subprocess.call(['mkdir', '-p', ENV_HOME+'/.config'])
if ( os.path.isfile(ENV_HOME+'/.config/what.config') ):
subprocess.call(['mkdir', '-p', ENV_HOME+'/.config/do_what'])
if ( os.path.isfile(ENV_HOME+'/.config/do_what/what.config') ):
config = configparser.ConfigParser()
config.read(ENV_HOME+'/.config/what.config')
config.read(ENV_HOME+'/.config/do_what/what.config')
if ( 'DEFAULT' in config ):
if ( 'print_file' in config['DEFAULT'] ):
print_file = config['DEFAULT']['print_file']
@ -60,7 +60,7 @@ else:
'print_file': print_file
}
print("echo Default config loaded.")
with open(ENV_HOME+'/.config/what.config', 'w') as configfile:
with open(ENV_HOME+'/.config/do_what/what.config', 'w') as configfile:
config.write(configfile)
configfile.close()