Skip to content

Commit 3e5604f

Browse files
committed
Bugfix: script can create folders no matter where
it is run from
1 parent 415f776 commit 3e5604f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

functions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def move_files(source_path, default_destination_folder): # Funcion para mover ar
4949
# ------------------------------- Modpacks ---------------------------
5050

5151
def create_modpack(directory_name): # Funcion para crear los modpacks, y en caso de que no exista tambien crea el directorio "Modpacks"
52-
modpacks_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'modpacks')
52+
modpacks_dir = os.path.join(os.getcwd(), 'modpacks')
5353
if not os.path.exists(modpacks_dir):
5454
os.makedirs(modpacks_dir)
5555
new_modpack_dir = os.path.join(modpacks_dir, directory_name)
@@ -105,7 +105,7 @@ def delete_modpack(): # Borra el modpack elegido por el usuario
105105
# ---------------------------- ResourcePacks ------------------------
106106

107107
def add_resource_pack(): # Funcion para agregar Resource Packs, pregunta si quiere moverlo o descargarlo y crea la carpeta en caso de que no exista
108-
resourcepacks_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'resourcepacks')
108+
resourcepacks_path = os.path.join(os.getcwd(), 'resourcepacks')
109109
destination_folder = resourcepacks_path
110110
os.makedirs(destination_folder, exist_ok=True)
111111
import_or_search = messagebox.askquestion("Import or search for mods", "Do you want to import Resource Packs from a local folder (Yes) or search for them in CurseForge? (No)", icon='warning')
@@ -134,7 +134,7 @@ def delete_rp():
134134
print(f'Error: {rp} : {e.strerror}')
135135

136136
def copy_to_clipboard_rp():
137-
resourcepacks_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'resourcepacks')
137+
resourcepacks_path = os.path.join(os.getcwd(), 'resourcepacks')
138138
destination_folder = resourcepacks_path
139139
os.makedirs(destination_folder, exist_ok=True)
140140
root = Tk()

0 commit comments

Comments
 (0)