Skip to content

Commit

Permalink
fix: XDG_DATA_DIRS is missing when starting AppImage on Fedora 24
Browse files Browse the repository at this point in the history
Closes #682
  • Loading branch information
develar committed Aug 20, 2016
1 parent 6d433ad commit 92d4895
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
14 changes: 3 additions & 11 deletions templates/linux/AppRun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,8 @@ echo "$APPDIR"

THIS="$0"

# $XDG_DATA_DIRS contains the default paths /usr/local/share:/usr/share
# desktop file has to be installed in an applications subdirectory
# of one of the $XDG_DATA_DIRS components
if [ -z "$XDG_DATA_DIRS" ] ; then
echo "\$XDG_DATA_DIRS is missing. Please run ${THIS} from within an AppImage."
exit 0
fi

export PATH="${APPDIR}/usr/bin:${APPDIR}/usr/sbin:${PATH}"
export XDG_DATA_DIRS="./share/:${XDG_DATA_DIRS}"
export LD_LIBRARY_PATH="${APPDIR}/usr/lib:${LD_LIBRARY_PATH}"
export XDG_DATA_DIRS="${APPDIR}/usr/share:${XDG_DATA_DIRS}"
export GSETTINGS_SCHEMA_DIR="${APPDIR}/usr/share/glib-2.0/schemas:${GSETTINGS_SCHEMA_DIR}"
Expand Down Expand Up @@ -180,7 +173,6 @@ if [ -z "$SKIP" ] ; then
--dir "$DESTINATION_DIR_DESKTOP"
chmod a+x "$DESTINATION_DIR_DESKTOP/"*
RESOURCE_NAME=$(echo "$VENDORPREFIX-$DESKTOP_FILE_NAME" | sed -e 's/.desktop//g')
echo "${RESOURCE_NAME}"

# uninstall previous icons
xdg-icon-resource uninstall --noupdate --size 16 "$RESOURCE_NAME"
Expand All @@ -205,10 +197,10 @@ if [ -z "$SKIP" ] ; then
xdg-icon-resource forceupdate

# Install mime type
find "$APPDIR/usr/share/mime/" -type f -name "*xml" -exec xdg-mime install ${SYSTEM_WIDE} --novendor {} \; || true
find "$APPDIR/usr/share/mime/" -type f -name "*xml" -exec xdg-mime install ${SYSTEM_WIDE} --novendor {} \; 2>/dev/null || true

# Install the icon files for the mime type; TODO: scalable
ICONS=$(find "${APPDIR}/usr/share/icons/" -wholename "*/mimetypes/*.png" || true)
ICONS=$(find "${APPDIR}/usr/share/icons/" -wholename "*/mimetypes/*.png" 2>/dev/null || true)
for ICON in $ICONS ; do
ICON_SIZE=$(echo "$ICON" | rev | cut -d "/" -f 3 | rev | cut -d "x" -f 1)
xdg-icon-resource install --context mimetypes --size "$ICON_SIZE" "$ICON" $(basename "$ICON" | sed -e 's/.png//g')
Expand Down
2 changes: 1 addition & 1 deletion test/src/helpers/packTester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export async function assertPack(fixtureName: string, packagerOptions: PackagerO
}

const projectDirCreated = checkOptions.projectDirCreated
const useTempDir = checkOptions.useTempDir !== false && (checkOptions.useTempDir || projectDirCreated != null || packagerOptions.devMetadata != null || checkOptions.npmInstallBefore)
const useTempDir = process.env.TEST_APP_TMP_DIR != null || (checkOptions.useTempDir !== false && (checkOptions.useTempDir || projectDirCreated != null || packagerOptions.devMetadata != null || checkOptions.npmInstallBefore))

let projectDir = path.join(__dirname, "..", "..", "fixtures", fixtureName)
// const isDoNotUseTempDir = platform === "darwin"
Expand Down

0 comments on commit 92d4895

Please sign in to comment.