Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# PyCharm
.idea

# vscode
.vscode

# Example builds
/recipes/*/AppDir
/recipes/*/appimage-build
Expand Down
3 changes: 2 additions & 1 deletion appimagebuilder/commands/deploy_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# all copies or substantial portions of the Software.
import logging
import os
from pathlib import PosixPath

from ruamel.yaml import YAML

Expand All @@ -25,7 +26,7 @@ def id(self):
return "write-deploy-record"

def __call__(self, *args, **kwargs):
path = self.context.app_dir / ".bundle.yml"
path = (PosixPath(self.context.recipe.AppDir.path()) or self.context.app_dir) / ".bundle.yml"
with open(path, "w") as f:
logging.info(
"Writing deploy record to: %s"
Expand Down
7 changes: 4 additions & 3 deletions appimagebuilder/commands/setup_app_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from appimagebuilder.modules.setup.icon_bundler import IconBundler
from appimagebuilder.context import AppInfo, Context
from appimagebuilder.commands.command import Command

from pathlib import PosixPath

class SetupAppInfoCommand(Command):
def __init__(self, context: Context):
Expand All @@ -25,10 +25,11 @@ def id(self):
return "app-info-setup"

def __call__(self, *args, **kwargs):
icon_bundler = IconBundler(self.context.app_dir, self.context.app_info.icon)
appdir_path = PosixPath(self.context.recipe.AppDir.path()) or self.context.app_dir
icon_bundler = IconBundler(appdir_path, self.context.app_info.icon)
icon_bundler.bundle_icon()

desktop_entry_generator = DesktopEntryGenerator(self.context.app_dir)
desktop_entry_generator = DesktopEntryGenerator(appdir_path)
desktop_entry_generator.generate(
self.context.app_info, self.context.bundle_info.runtime_arch
)
3 changes: 2 additions & 1 deletion appimagebuilder/modules/prime/appimage_primer.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ def prime(self):
if not self.carrier_path.exists():
self._get_appimage_kit_runtime()

appdir_path = pathlib.PosixPath(self.context.recipe.AppDir.path()) or self.context.app_dir
# create payload
payload_path = self._make_squashfs(self.context.app_dir)
payload_path = self._make_squashfs(appdir_path)

# prepare carrier (a.k.a. "runtime" using a different name to differentiate from the AppRun settings)
shutil.copyfile(self.carrier_path, self.appimage_path)
Expand Down
4 changes: 2 additions & 2 deletions appimagebuilder/modules/setup/apprun_2/apprun2.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import random
import shutil
import string
from pathlib import Path
from pathlib import Path, PosixPath
from typing import Final

from packaging import version
Expand Down Expand Up @@ -61,7 +61,7 @@ def __init__(self, context: Context, finder: Finder):
self.context = context
recipe = context.recipe

self.appdir_path = self.context.app_dir
self.appdir_path = PosixPath(recipe.AppDir.path()) or self.context.app_dir
self.main_exec = recipe.AppDir.app_info.exec()
self.main_exec_args = recipe.AppDir.app_info.exec_args() or "$@"
self.apprun_version = recipe.AppDir.runtime.version() or "v2.0.0"
Expand Down
6 changes: 5 additions & 1 deletion appimagebuilder/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ def _create_setup_commands(self, context, recipe):
)
commands.append(command)

finder = Finder(context.app_dir)
if os.path.exists(recipe.AppDir.path()):
finder = Finder(pathlib.PosixPath(recipe.AppDir.path()))
else:
finder = Finder(context.app_dir)

commands.append(SetupSymlinksCommand(context, recipe, finder))

commands.append(SetupRuntimeCommand(context, finder))
Expand Down