Comments (8)
What is preventing you from doing that?
from aconfmgr.
By that i meant having a set flag, by default aconfmgr will use the file/ folder
and i'm asking if there is an option to change that folder upon specific conditions ?
from aconfmgr.
Okay, so you would like to have a way to configure aconfmgr save
to save some files to a different location.
There is currently no option to do that automatically.
from aconfmgr.
Yep pretty much rather
something like
$islaptop && SetAdditionalFilesSavePath path/to/files-laptop || SetAdditionalFilesSavePath path/to/files-desktop
but also have it look in the original files/
for files all computers have in common ^
Having it just something you call at the begining of the script ^
so it would first look in all the additional files-* directory and if a file isn't found there it will take the one from the default files/ directory if that make sense ^
from aconfmgr.
How would aconfmgr save
decide which directory to put new files in?
from aconfmgr.
@CyberShadow I think using a default directory but having a flag such as -d would be the best of both world, then feel free to do it or not :)
maybe have an user editable script in .config/aconfmgr that define how the save function chose which directory to put file so you could do something like
SetDefaultDirectory or SetBaseDirectory directory (optionalpriority)
$islaptop && SetAditionalDirectory laptopdir/ (optionalpriority)
$îsdesktop && SetAditionalDirectory desktopdir/ (optional priority)
And have Base/default directory the highest priority by default but have something like
SetDefaultDirectoryPriority (priority)
and SetAditionalDirectory (priority)
from aconfmgr.
As far as I understand, you can achieve what you want without any changes in aconfmgr.
- There exists a
CopyFileTo
helper, which allows specifying different source and target paths. This allows copying different files depending on the current system. - You could also define a custom helper which looks in multiple directories as you described. You could even redefine
CopyFile
to do that, so that the configuration generated byaconfmgr save
does that by default. - As for
aconfmgr save
, since it always puts new files in thefiles/
directory, you could write an aconfmgr wrapper script which symlinksconfig/files
to e.g.files_$HOSTNAME
before executing aconfmgr.
I think it is worthwhile to make it easier to manage different file versions for different systems, but I'm not sure that the above is necessarily the best way to approach this problem.
from aconfmgr.
This area looks like a good topic to develop as a set of third-party helpers; perhaps if an victorious solution with clear benefits emerges, it could be adopted.
If there is something missing in aconfmgr to allow such helpers to work (e.g. some hooks for saving), that can be filed as separate issues.
Let's continue here: https://github.com/CyberShadow/aconfmgr/wiki
from aconfmgr.
Related Issues (20)
- GetPackageOriginalFile errors bsdtar: Error opening archive: Unrecognized archive format HOT 3
- FatalError with trace, no specific information, --verbose does nothing HOT 30
- /tmp/aconfmgr-$USER is created with world-readable permissions HOT 6
- Shell Script Syntax HOT 3
- package `expect` gets installed and uninstalled on every run of `aconfmgr apply` HOT 2
- Getting prompted about `Restoring a52dec file /usr/bin...` HOT 14
- Inline fstab entry without saving or overwriting genfstab-generated portion? HOT 3
- Target a different installation than the one on / HOT 3
- documentation for IgnorePath syntax HOT 2
- factoring out base group? HOT 1
- [Bug]: Inconsistent ownership of /usr/lib/node_modules HOT 3
- [Bug]: Changed file duplicates `CopyFile` in 99-unsorted HOT 2
- [Bug]: Insecure permissions for file copies HOT 1
- Glitches out with --yes HOT 6
- Duplicate "provides" packages are not uninstalled HOT 1
- [Bug]: Some symlinks don't work HOT 2
- Weird behaviour on Arch Linux 32: Asking for overwriting files with no changes HOT 10
- Inline editing with `CopyFile` ?
- Incorrect modes on files after change
- Filename-based ignores? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aconfmgr.