mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-14 01:28:18 +01:00
Better ask forgiveness than permission
This commit is contained in:
parent
62e715ff5b
commit
bf87f37039
@ -24,12 +24,15 @@ SKIP_FILENAMES = [
|
|||||||
|
|
||||||
|
|
||||||
def get_options(source):
|
def get_options(source):
|
||||||
source_dirpath = path.dirname(source)
|
|
||||||
options = BAT_OPTIONS.copy()
|
options = BAT_OPTIONS.copy()
|
||||||
|
|
||||||
|
source_dirpath = path.dirname(source)
|
||||||
options_file = path.join(source_dirpath, "bat_options")
|
options_file = path.join(source_dirpath, "bat_options")
|
||||||
if path.exists(options_file):
|
try:
|
||||||
with open(options_file, "r") as f:
|
with open(options_file, "r") as f:
|
||||||
options += list(map(lambda x: x.rstrip(), f.readlines()))
|
options += list(map(lambda x: x.rstrip(), f.readlines()))
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
return options
|
return options
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user