mirror of https://github.com/cheat/cheat.git
Var renames
Replaced more references to deprecated envvar names to their newer counterparts.
This commit is contained in:
parent
7c4fc54681
commit
145a81dcd6
|
@ -13,7 +13,7 @@ Usage:
|
||||||
cheat -v
|
cheat -v
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-d --directories List directories on CHEATPATH
|
-d --directories List directories on $CHEAT_PATH
|
||||||
-e --edit Edit cheatsheet
|
-e --edit Edit cheatsheet
|
||||||
-l --list List cheatsheets
|
-l --list List cheatsheets
|
||||||
-s --search Search cheatsheets for <keyword>
|
-s --search Search cheatsheets for <keyword>
|
||||||
|
|
|
@ -13,12 +13,12 @@ class Sheet:
|
||||||
def copy(self, current_sheet_path, new_sheet_path):
|
def copy(self, current_sheet_path, new_sheet_path):
|
||||||
""" Copies a sheet to a new path """
|
""" Copies a sheet to a new path """
|
||||||
|
|
||||||
# attempt to copy the sheet to DEFAULT_CHEAT_DIR
|
# attempt to copy the sheet to CHEAT_DEFAULT_DIR
|
||||||
try:
|
try:
|
||||||
shutil.copy(current_sheet_path, new_sheet_path)
|
shutil.copy(current_sheet_path, new_sheet_path)
|
||||||
|
|
||||||
# fail gracefully if the cheatsheet cannot be copied. This can happen
|
# fail gracefully if the cheatsheet cannot be copied. This can happen
|
||||||
# if DEFAULT_CHEAT_DIR does not exist
|
# if CHEAT_DEFAULT_DIR does not exist
|
||||||
except IOError:
|
except IOError:
|
||||||
Utils.die('Could not copy cheatsheet for editing.')
|
Utils.die('Could not copy cheatsheet for editing.')
|
||||||
|
|
||||||
|
|
|
@ -67,15 +67,15 @@ class Sheets:
|
||||||
self.default_path(),
|
self.default_path(),
|
||||||
]
|
]
|
||||||
|
|
||||||
# merge the CHEATPATH paths into the sheet_paths
|
# merge the CHEAT_PATH paths into the sheet_paths
|
||||||
if self._config.cheat_path:
|
if self._config.cheat_path:
|
||||||
for path in self._config.cheat_path.split(os.pathsep):
|
for path in self._config.cheat_path.split(os.pathsep):
|
||||||
if os.path.isdir(path):
|
if os.path.isdir(path):
|
||||||
sheet_paths.append(path)
|
sheet_paths.append(path)
|
||||||
|
|
||||||
if not sheet_paths:
|
if not sheet_paths:
|
||||||
Utils.die('The DEFAULT_CHEAT_DIR dir does not exist '
|
Utils.die('The CHEAT_DEFAULT_DIR dir does not exist '
|
||||||
+ 'or the CHEATPATH is not set.')
|
+ 'or the CHEAT_PATH is not set.')
|
||||||
|
|
||||||
return sheet_paths
|
return sheet_paths
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue