Compare commits

..

No commits in common. "master" and "0.21.0" have entirely different histories.

5 changed files with 5 additions and 36 deletions

View file

@ -80,7 +80,7 @@ jobs:
- run: mkdir -p build dist
- name: Dependencies
run: uv export --format requirements.txt --no-editable --no-dev | uv pip install --requirement - --target build
run: uv export --format requirements.txt --no-editable | uv pip install --requirement - --target build
- run: cp zipapp_main.py build/__main__.py

View file

@ -687,18 +687,15 @@ class LegendaryCLI:
if args.json:
return self._print_json(vars(params), args.pretty_json)
# Copying existing env vars is required on Windows, probably a good idea on Linux
full_env = os.environ.copy()
full_env.update(params.environment)
full_params = list()
full_params.extend(params.launch_command)
if 'LEGENDARY_WRAPPER_EXE' in full_env:
full_params.append(full_env['LEGENDARY_WRAPPER_EXE'].strip())
full_params.append(os.path.join(params.game_directory, params.game_executable))
full_params.extend(params.game_parameters)
full_params.extend(params.user_parameters)
full_params.extend(params.egl_parameters)
# Copying existing env vars is required on Windows, probably a good idea on Linux
full_env = os.environ.copy()
full_env.update(params.environment)
if 'CX_BOTTLE' in full_env and any('SharedSupport/CrossOver' in p for p in params.launch_command):
# if using crossover, unset WINEPREFIX
@ -839,7 +836,7 @@ class LegendaryCLI:
logger.warning(f'Pre-launch command failed: {e!r}')
logger.debug(f'Opening URI with command: {shlex.join(command)}')
subprocess.Popen(command, env=full_env, cwd=full_env.get('WINEPREFIX', None))
subprocess.Popen(command, env=full_env)
def install_game(self, args):
if not self.core.lgd.lock_installed():

View file

@ -344,10 +344,6 @@ class DLManager(Process):
# skip unchanged and empty files
if current_file.filename in mc.unchanged:
continue
elif current_file.symlink_target:
self.tasks.append(FileTask(current_file.filename, old_file=current_file.symlink_target,
flags=TaskFlags.CREATE_SYMLINK))
continue
elif not current_file.chunk_parts:
self.tasks.append(FileTask(current_file.filename, flags=TaskFlags.CREATE_EMPTY_FILE))
continue

View file

@ -205,29 +205,6 @@ class FileWorker(Process):
if j.flags & TaskFlags.CREATE_EMPTY_FILE: # just create an empty file
open(full_path, 'a').close()
self.o_q.put(WriterTaskResult(success=True, **j.__dict__))
continue
if j.flags & TaskFlags.CREATE_SYMLINK:
if current_file:
logger.warning('Trying to create symlink without closing first!')
current_file.close()
current_file = None
try:
os.symlink(j.old_file, full_path)
except FileExistsError:
try:
os.remove(full_path)
os.symlink(j.old_file, full_path)
except OSError as e:
logger.error(f'Creating symlink failed: {e!r}')
self.o_q.put(WriterTaskResult(success=False, **j.__dict__))
continue
except OSError as e:
logger.error(f'Creating symlink failed: {e!r}')
self.o_q.put(WriterTaskResult(success=False, **j.__dict__))
continue
self.o_q.put(WriterTaskResult(success=True, **j.__dict__))
continue
elif j.flags & TaskFlags.OPEN_FILE:

View file

@ -59,7 +59,6 @@ class TaskFlags(Flag):
CLOSE_FILE = auto()
DELETE_FILE = auto()
CREATE_EMPTY_FILE = auto()
CREATE_SYMLINK = auto()
RENAME_FILE = auto()
RELEASE_MEMORY = auto()
MAKE_EXECUTABLE = auto()