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

Support for importing/exporting of projects #24

Open
okcoker opened this issue Apr 21, 2015 · 11 comments
Open

Support for importing/exporting of projects #24

okcoker opened this issue Apr 21, 2015 · 11 comments

Comments

@okcoker
Copy link

okcoker commented Apr 21, 2015

It would be useful to have import/export/sync options so I can host my project settings on something like Dropbox and have CCMenu read from that location across my machines.

@erikdoe
Copy link
Member

erikdoe commented May 11, 2015

I understand the request. Implementing it is actually not quite as simple.

Firstly, the code currently uses the user defaults API to manage the project list. This would have to be re-written to use a file API.

Secondly, CCMenu runs as a sandboxed application and cannot write to arbitrary places without the user confirming the location in a file selector dialogue. I guess, if the new implementation would ask the user where to keep the files using a file selector this might solve itself.

I'll keep this open as an enhancement request.

@okcoker
Copy link
Author

okcoker commented May 11, 2015

Makes sense. Thanks!

@raymondberg
Copy link

Biggest use-case, even without automated sync: I work on a team with a few builds, and on-boarding folks to the team is much more complicated without the ability to share an initial config file. A walkthrough of this flow would be:

  1. Open the ccmenu 'import config' menu
  2. Click import and select our team_config.json (or whatever)
  3. Click replace all (vs add missing)

This is not meant to be a you should just, but I've come back to this page a few times and each time mused over the smallest requirement gap, what would REALLY that would be helpful. I do think this would be a valuable feature.

Love the tool, thanks for all the great work!

@erikdoe
Copy link
Member

erikdoe commented Feb 6, 2017

You can share an initial config file using the defaults system. Quit CCMenu, run the following command in Terminal, and then restart CCMenu.

defaults write net.sourceforge.cruisecontrol.CCMenu Projects '
(
  {
    projectName = connectfour;
    serverUrl = "http://localhost:4567/cctray.xml";
  }
)'

Hope this helps.

@kigster
Copy link

kigster commented Apr 3, 2018

Why is it not possible to simply backup the plist file to reuse it?

I tried doing that, but it fricken wiped all of my seventeen projects. Extremely frustrating! This happend on the same box that it was created on. Meh.

@mrmanc
Copy link

mrmanc commented May 16, 2018

I think I’ve just successfully migrated my settings by running defaults export -app CCMenu ccmenu.plist to export the settings, and defaults import net.sourceforge.cruisecontrol.CCMenu ccmenu.plist on the new machine to import. Putting it in this issue as this crops up first on Google.

@HariSekhon
Copy link

HariSekhon commented Sep 29, 2020

I converted mine to XML and saved to Git so I am able to easily add/edit/change order of repos and then just reload from there using a script.

Testing the export command above on a new Mac I find that the conversion to XML is giving this error, which also happened when I ran a convert on the plist file location to see what my new machine's XML would have come out to:

ccmenu.plist: Property List error: Unexpected character b at line 1 / JSON error: JSON text did not start with array or object and option to allow fragments not set.

Got the same error trying to convert to JSON.

Any ideas why?

@mrmanc
Copy link

mrmanc commented Sep 30, 2020

Testing the export command above on a new Mac I find that the conversion to XML is giving this error

Which command gave you that error? If you meant the defaults export -app CCMenu ccmenu.plist command I recommended, then there’s no conversion to XML involved (unless you’ve added something to the command to do that)? The command creates a plist file which can then be imported elsewhere, not a JSON file. Could that be your issue?

@HariSekhon
Copy link

I meant the conversion to XML from the export, something like this:

plutil -convert xml1 ccmenu.plist 

Although I've just tested this on another Mac of mine and it didn't happen, even though I revision control my CCMenu config and load it to each machine from the same committed XML.

@richellis
Copy link

If you are in a situation where you can't use the defaults export method, such as manually restoring your preferences from a backup, I found that you can copy ~/Library/Containers/net.sourceforge.cruisecontrol.CCMenu from your backup to your new machine and then install the CCMenu app. All of my previous builds and preferences were preserved.

@HariSekhon
Copy link

HariSekhon commented Oct 29, 2020

@richellis I actually converted my CCMenu ~/Library plist to XML and revision control it in Git, and then reload it from the XML using a script on each machine to keep them in sync. It's even better than using your backups.

In fact it works so well that I now find it's the easiest way to add more repos to the config by copying a couple lines and then running the setup script across my machines, and by far the easiest way to reorder repos as I add more and tune the visuals based on say the name length or grouping similar repos together.

Both my CCMenu config and the script are available on my Github's DevOps Bash tools repo along with all my other dotfile configs and bash scripts. I mirror the Library/ path for storing the config and the script is under setup/.

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

7 participants