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.

Linking to a target defined by the output of a command

See original GitHub issue

Hi, I tried to add my Firefox ‘chrome’ directory to dotbot today, but the challenge is that it is stored inside the profile directory: ~/.mozilla/firefox/XXXXXX.default/chrome, where XXXXXX is some random string that will be different on different machines (and may change, in theory, if I reconstruct a profile).

I can get that string, and hence construct the path, by running:

grep 'Path=' ~/.mozilla/firefox/profiles.ini | sed s/^Path=//

but it doesn’t seem that dotbot has support for embedding that in the link directive.

I tried:

- link:
    ~/.mozilla/firefox/$(grep 'Path=' ~/.mozilla/firefox/profiles.ini | sed s/^Path=//)/chrome: firefox/chrome

I also tried using a glob, but I guess this only works for the source, not the target. E.g., the following doesn’t work either (yes I enabled globbing):

- link:
    ~/.mozilla/firefox/*.default/chrome: firefox/chrome

Could either of these two things (globbing on targets or $() be implemented, please?

Or if there’s a better way to achieve what I’m trying to do, please let me know 😃

Thanks for dotbot!

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
99-livescommented, May 26, 2021

Not to resurrect a dead issue, but I thought I’d post my solution to this for anyone who wants to keep their Firefox userChrome.css and user.js files in dotbot.

- shell:
    - [for profile in `grep Path ~/.mozilla/firefox/profiles.ini | sed s/^Path=//`; do mkdir ~/.mozilla/firefox/$profile/chrome/; ln -nsf $(pwd)/userChrome.css ~/.mozilla/firefox/$profile/chrome/userChrome.css; done, Linking Firefox userChrome.css to profiles]
    - [for profile in `grep Path ~/.mozilla/firefox/profiles.ini | sed s/^Path=//`; do ln -nsf $(pwd)/user.js ~/.mozilla/firefox/$profile/user.js; done, Linking Firefox user.js to profiles]

Unlike the above solutions, this is entirely within install.yaml.conf, and will work for every profile, on every device. I use multiple Firefox profiles (personal and work) across multiple devices, so this works much better for that use case. Feel free to stick this in the wiki if you want @anishathalye.

0reactions
anishathalyecommented, May 7, 2020

Closing due to inactivity, feel free to reopen if there’s anything else.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command Line Basics: Symbolic Links - DigitalOcean
Learn how to create symbolic links between files and directories from the command-line using the ln command.
Read more >
4.4. Simple Linker Script Commands
The INPUT command directs the linker to include the named files in the link, as though they were named on the command line....
Read more >
Using LD, the GNU linker - Command Line Options
Generate relocatable output--i.e., generate an output file that can in turn serve as input to ld . This is often called partial linking....
Read more >
Find out symbolic link target via command line - Server Fault
Use the -f flag to print the canonicalized version. For example: readlink -f /root/Public/myothertextfile.txt. From man readlink :
Read more >
Using LD, the GNU linker - Invocation
This tells ld to produce a file called output as the result of linking the ... You can also define the input format...
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