question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to check XDG_CACHE_HOME

See original GitHub issue

Hi,

I want to write a cache file to speed up later runs of the appimage. For this I want to check XDG_CACHE_HOME and have a fallback variable for when it is not set.

In bash the check would look like this:

 echo ${XDG_CACHE_HOME:-$HOME/.cache}

Documentation for this is here: https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html

Setting that in the recipe results in wrong path descriptions.

    runtime:
      path_mappings:
        - /dev/:$APPDIR/dev
      env:
        GST_PLUGIN_SYSTEM_PATH_1_0: '${APPDIR}/usr/lib/@CMAKE_SYSTEM_PROCESSOR@-linux-gnu/gstreamer-1.0' 
        GST_REGISTRY: "${XDG_CACHE_HOME:-$HOME/.cache}/application/gstreamer-cache.bin"

That writes to /home/user/-/home/user/.cache/application/. Is there a way to have such a check or is it simply impossible?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
azubietacommented, May 12, 2022

This is now documented at https://appimage-builder.readthedocs.io/en/latest/advanced/helpers.html

Closing the issue, please feel free to reopen if needed.

0reactions
azubietacommented, Dec 9, 2021

Is there any documentation as to what helpers exist and what they do?

Sorry for that, right now the only documentation is the code. It would be great if someone could assist me on documenting them. These are the helpers available: https://github.com/AppImageCrafters/appimage-builder/tree/master/appimagebuilder/modules/setup/helpers

Read more comments on GitHub >

github_iconTop Results From Across the Web

XDG Base Directory - ArchWiki
Application Legacy Path Supported Since ALSA ~/.asoundrc 577df36 · 1.2.3 Android Studio ~/.AndroidStudioX.X Android Studio 4.1 Anki ~/Anki , ~/Documents/Anki
Read more >
XDG Base Directory Specification
$XDG_STATE_HOME defines the base directory relative to which user-specific state files should be stored. If $XDG_STATE_HOME is either not set or ...
Read more >
Declutter Your Home Directory With The XDG Base ... - YouTube
I noticed that my home directory was becoming an absolute mess recently I had so many files in it that shouldn't have been...
Read more >
xdg/README.md at master · adrg/xdg - GitHub
Go implementation of the XDG Base Directory Specification and XDG user directories ... XDG_CACHE_HOME, ~/.cache, ~/Library/Caches, $home/lib/cache.
Read more >
XDGBaseDirectorySpecification - Debian Wiki
The XDG Base Directory Specification (XDGBDS) defines four categories of so called DotFiles and the corresponding directories in a users ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found