Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy and symlink various files using rcup and rcrc #244

Open
Tank-Missile opened this issue May 22, 2019 · 5 comments
Open

Copy and symlink various files using rcup and rcrc #244

Tank-Missile opened this issue May 22, 2019 · 5 comments

Comments

@Tank-Missile
Copy link

Tank-Missile commented May 22, 2019

I set up two tagged directories, tag-Copy and tag-Link. The copy directory would have all its files copied, and the link directory would have all its files symlinked. In the same directory as these two directories, I have an rcrc file. This file is symlinked to my home directory by running rcup -d ~/Nextcloud/Dotfiles. However, no matter how I set COPY_ALWAYS, files in tag-Copy are symlinked instead of copied. Unrelated to a possible misconfiguration or bug, could an option for specifying if files are copied or symlinked based on tags be added? This is the contents to my .rcrc file:

DOTFILES_DIRS=$(dirname $(readlink -f $BASH_SOURCE))
TAGS="Copy Link"
COPY_ALWAYS="lsrc -Ft Copy"
@mat-m
Copy link
Contributor

mat-m commented May 3, 2020

COPY_ALWAYS is a variable containing patterns for matching files and cannot contain a command as shown in your .rcrc file.

Tags were brought in rcm to be able to deploy files depending on conditions, not to choose how to deploy files.

@mat-m
Copy link
Contributor

mat-m commented Oct 17, 2020

Hello @Tank-Missile ,

I am starting the discussion suggested by Mike's tag ^^

Main issue there is that rcm is primarily targeted to symlink files. Copies are exceptions, and treated as such by the COPY_ALWAYS variable or the -C flag of commands.
Tags were added for functional separation (bash vs zsh, webserver vs laptop,...).
I like those principles, but I am seeing some potential in your proposal.

If we would do that, we might use a static pattern like process-Copy, but we may have some complexity when processing folders, finding whether they are expected to be symlinks, creation, copies or nothing.
What other actions, than Copy could this be useful for ?
Do you have that many files to copy ?

@mat-m
Copy link
Contributor

mat-m commented Dec 17, 2020

@Tank-Missile Keeping on discussion:
What is the usage of the files you copy. In my view, it may not belong to dotfiles and thus rcm, but more in a script to download them from a static repo.
Without your view and details, we can't go further.

ATB

@Tank-Missile
Copy link
Author

@mat-m Sorry for not responding sooner, but I only just remembered why I attempted to split my dotfiles into symlinked and copied files. Certain files such as my steam settings and chromium settings don't work at all when symlinked from another directory. Certain KDE dotfiles also contain session data, which changes even if no settings were changed. This would end up polluting my Nextcloud log with unnecessary file change messages. Instead, for copied files, I could make changes, and then have them copied by running rcup.

@mat-m
Copy link
Contributor

mat-m commented Dec 27, 2020

@Tank-Missile :
you can try to create a steam folder containing required files, and add it to COPY_ALWAYS. Then the folder will be copied with its contents, used as a bootstrap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants