Code Monkey home page Code Monkey logo

Comments (8)

CyberShadow avatar CyberShadow commented on May 26, 2024

What is preventing you from doing that?

from aconfmgr.

alkeryn avatar alkeryn commented on May 26, 2024

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.

CyberShadow avatar CyberShadow commented on May 26, 2024

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.

alkeryn avatar alkeryn commented on May 26, 2024

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.

CyberShadow avatar CyberShadow commented on May 26, 2024

How would aconfmgr save decide which directory to put new files in?

from aconfmgr.

alkeryn avatar alkeryn commented on May 26, 2024

@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.

CyberShadow avatar CyberShadow commented on May 26, 2024

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 by aconfmgr save does that by default.
  • As for aconfmgr save, since it always puts new files in the files/ directory, you could write an aconfmgr wrapper script which symlinks config/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.

CyberShadow avatar CyberShadow commented on May 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.