@@ -729,6 +729,17 @@ def project_enable(dir, urlslug, enable, world=None):
729729 print (f'The project { urlslug } is not installed in "{ dir } "' )
730730
731731
732+ def open_dir (dir , world = None ):
733+ data = mcsmp (dir )
734+ path = data ['path' ]
735+ if world :
736+ if world in data ['datapack' ]:
737+ os .path .join (path , 'saves' , world )
738+ else :
739+ print (f'No world "{ world } " in directory "{ dir } ". Opening the directory folder instead.' )
740+
741+ os .startfile (path )
742+
732743
733744def project_info (urlslug ):
734745 urlslug = urlslug .lower ()
@@ -829,14 +840,15 @@ def usage():
829840 print (" disable <DIR> <PROJECT> - disable a project" )
830841 print (" uninstall <DIR> <PROJECT> - uninstall a project" )
831842 print (" update <DIR> - update all projects in a directory" )
843+ print (" open <DIR> - open the folder of a directory" )
832844 print ()
833845 print (" info <PROJECT> - show info about a project" )
834846 print (" api URL [-- PARAMS ...]] - print a API request" )
835847 print (" clear-cache [FILE ...]] - clear the cache, or specific cache files" )
836848 print ()
837849 print ("DIR is the target directory to manage" )
838850 print ("PROJECT is the slug-name of the wanted project" )
839- print ("WORLD is to target a specific world (datapack), always at the end (last argument )" )
851+ print ("WORLD can be added a the end of many of the commands, to target a specific world (ex. for datapack )" )
840852 exit ()
841853
842854
@@ -877,6 +889,8 @@ def main():
877889 project_uninstall (get_arg_n (2 ), get_arg_n (3 ), get_arg_n (4 , False ))
878890 elif cmd == 'update' :
879891 project_update (get_arg_n (2 ), get_arg_n (3 , False ))
892+ elif cmd == 'open' :
893+ open_dir (get_arg_n (2 ), get_arg_n (3 , False ))
880894
881895 elif cmd == 'info' :
882896 project_info (get_arg_n (2 ))
0 commit comments