Skip to content

Commit 92d4895

Browse files
committed
fix: XDG_DATA_DIRS is missing when starting AppImage on Fedora 24
Closes #682
1 parent 6d433ad commit 92d4895

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

templates/linux/AppRun.sh

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,8 @@ echo "$APPDIR"
1010

1111
THIS="$0"
1212

13-
# $XDG_DATA_DIRS contains the default paths /usr/local/share:/usr/share
14-
# desktop file has to be installed in an applications subdirectory
15-
# of one of the $XDG_DATA_DIRS components
16-
if [ -z "$XDG_DATA_DIRS" ] ; then
17-
echo "\$XDG_DATA_DIRS is missing. Please run ${THIS} from within an AppImage."
18-
exit 0
19-
fi
20-
2113
export PATH="${APPDIR}/usr/bin:${APPDIR}/usr/sbin:${PATH}"
14+
export XDG_DATA_DIRS="./share/:${XDG_DATA_DIRS}"
2215
export LD_LIBRARY_PATH="${APPDIR}/usr/lib:${LD_LIBRARY_PATH}"
2316
export XDG_DATA_DIRS="${APPDIR}/usr/share:${XDG_DATA_DIRS}"
2417
export GSETTINGS_SCHEMA_DIR="${APPDIR}/usr/share/glib-2.0/schemas:${GSETTINGS_SCHEMA_DIR}"
@@ -180,7 +173,6 @@ if [ -z "$SKIP" ] ; then
180173
--dir "$DESTINATION_DIR_DESKTOP"
181174
chmod a+x "$DESTINATION_DIR_DESKTOP/"*
182175
RESOURCE_NAME=$(echo "$VENDORPREFIX-$DESKTOP_FILE_NAME" | sed -e 's/.desktop//g')
183-
echo "${RESOURCE_NAME}"
184176

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

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

210202
# Install the icon files for the mime type; TODO: scalable
211-
ICONS=$(find "${APPDIR}/usr/share/icons/" -wholename "*/mimetypes/*.png" || true)
203+
ICONS=$(find "${APPDIR}/usr/share/icons/" -wholename "*/mimetypes/*.png" 2>/dev/null || true)
212204
for ICON in $ICONS ; do
213205
ICON_SIZE=$(echo "$ICON" | rev | cut -d "/" -f 3 | rev | cut -d "x" -f 1)
214206
xdg-icon-resource install --context mimetypes --size "$ICON_SIZE" "$ICON" $(basename "$ICON" | sed -e 's/.png//g')

test/src/helpers/packTester.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export async function assertPack(fixtureName: string, packagerOptions: PackagerO
5757
}
5858

5959
const projectDirCreated = checkOptions.projectDirCreated
60-
const useTempDir = checkOptions.useTempDir !== false && (checkOptions.useTempDir || projectDirCreated != null || packagerOptions.devMetadata != null || checkOptions.npmInstallBefore)
60+
const useTempDir = process.env.TEST_APP_TMP_DIR != null || (checkOptions.useTempDir !== false && (checkOptions.useTempDir || projectDirCreated != null || packagerOptions.devMetadata != null || checkOptions.npmInstallBefore))
6161

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

0 commit comments

Comments
 (0)