bugs!
This commit is contained in:
parent
8ae574a136
commit
d94f945a6a
@ -14,7 +14,6 @@ This project is currently a work-in-progress. Only the fish shell is supported a
|
|||||||
## TODO
|
## TODO
|
||||||
- Documentation/License
|
- Documentation/License
|
||||||
- Installation & Generalization
|
- Installation & Generalization
|
||||||
- Zsh Support
|
|
||||||
- Command Memory/Env Support
|
- Command Memory/Env Support
|
||||||
- Double wh does an la, not ls
|
- Double wh does an la, not ls
|
||||||
- Git Repo detection for ls
|
- Git Repo detection for ls
|
||||||
|
10
do_what.py
10
do_what.py
@ -14,7 +14,7 @@ list_directory="ls --color=auto"
|
|||||||
def set_runtime_var(name, value, options=""):
|
def set_runtime_var(name, value, options=""):
|
||||||
if ( shell == "fish" ):
|
if ( shell == "fish" ):
|
||||||
print("set "+name+" "+options+" \""+value+"\"")
|
print("set "+name+" "+options+" \""+value+"\"")
|
||||||
elif ( shell == "bash" || shell == "zsh" ):
|
elif ( shell == "bash" or shell == "zsh" ):
|
||||||
print("export "+name+"="+"\""+value+"\"")
|
print("export "+name+"="+"\""+value+"\"")
|
||||||
|
|
||||||
def is_binary_file(filepathname):
|
def is_binary_file(filepathname):
|
||||||
@ -38,10 +38,10 @@ def file_len(fname):
|
|||||||
|
|
||||||
# bootstrap the config
|
# bootstrap the config
|
||||||
ENV_HOME=os.environ['HOME']
|
ENV_HOME=os.environ['HOME']
|
||||||
subprocess.call(['mkdir', '-p', ENV_HOME+'/.config'])
|
subprocess.call(['mkdir', '-p', ENV_HOME+'/.config/do_what'])
|
||||||
if ( os.path.isfile(ENV_HOME+'/.config/what.config') ):
|
if ( os.path.isfile(ENV_HOME+'/.config/do_what/what.config') ):
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read(ENV_HOME+'/.config/what.config')
|
config.read(ENV_HOME+'/.config/do_what/what.config')
|
||||||
if ( 'DEFAULT' in config ):
|
if ( 'DEFAULT' in config ):
|
||||||
if ( 'print_file' in config['DEFAULT'] ):
|
if ( 'print_file' in config['DEFAULT'] ):
|
||||||
print_file = config['DEFAULT']['print_file']
|
print_file = config['DEFAULT']['print_file']
|
||||||
@ -60,7 +60,7 @@ else:
|
|||||||
'print_file': print_file
|
'print_file': print_file
|
||||||
}
|
}
|
||||||
print("echo Default config loaded.")
|
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)
|
config.write(configfile)
|
||||||
configfile.close()
|
configfile.close()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user