File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414from click import echo
1515from click import style
1616
17+ from .constants import AUTOSAVE_MISSING
1718from .constants import CMUS_OSX_FOLDER_NAME
1819from .constants import CONFIG_NAME
1920from .constants import COULD_NOT_LOCATED_CMUS_DIRECTORY
@@ -67,6 +68,16 @@ def entrypoint(ctx):
6768 with open (config_path , "w" ) as f :
6869 f .write (template (ENV_VAR_PREFIX , ENV ))
6970
71+ if not cmus_config .rc_path .is_file ():
72+ cmus_config .rc_path .touch ()
73+
74+ if not cmus_config .autosave_path .is_file ():
75+ echo (
76+ f"{ style ('ERROR' , fg = 'red' )} : cmus config file missing (launch cmus at least once "
77+ "before attempting installation)"
78+ )
79+ exit (AUTOSAVE_MISSING )
80+
7081 locals_ = locals ()
7182
7283 for local in (local for local in locals_ if local != "ctx" ):
Original file line number Diff line number Diff line change 3434}
3535
3636COULD_NOT_LOCATED_CMUS_DIRECTORY = 1
37+ AUTOSAVE_MISSING = 2
3738
3839ENV_VAR_PREFIX = "CMUS_OSX"
3940ENV : Dict [str , Default ] = {
You can’t perform that action at this time.
0 commit comments