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.

-d flag removes contents of already existing directory, though does not say in README

See original GitHub issue

Using the -d or --plugin-download-directory will remove the directory/contents specified with the flag, even if there are contents there. This is not reflected in the README:

--plugin-download-directory or -d: (optional) Path to the directory in which to install plugins, which can also be set via
 the PLUGIN_DIR environment variable. Directory will be created if it does not exist. If no directory is entered, directory
 will default to C:\ProgramData\Jenkins\Reference\Plugins if detected OS is Windows, or /usr/share/jenkins/ref/plugins 
otherwise.

I don’t believe this should be the default behavior. There should be at least a warning letting the user know that it whatever is there will be removed or that location already exists. I just found this out the hard way as I pointed -d to my current plugins folder which caused the removal of all of my plugins, and now Jenkins wants to uninstall them on next reboot since they’re missing.

Please feel free to correct me if I have something wrong.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
timjacommented, Jun 30, 2020

This was a quick fix to an issue we had with failed plugin downloads never being cleared up.

The proper fix would either be:

  • Download plugins to a tmp directory and move when successful
  • delete failed downloads only
2reactions
ricksbrowncommented, Jun 30, 2020

IMHO the directory should be deleted so that it contains only the plugins listed in the YAML file (and the resulting dependency tree).

Otherwise plugin-installation-manager-tool cannot be used in IasC to uninstall plugins when they are removed from config, it can only ever add new plugins, leaving unlisted ones installed forever.

Also I would DL them all to tmp, and only move them when the entire list is successful - i.e. the entire operation is atomically successful or atomically fails.

Read more comments on GitHub >

github_iconTop Results From Across the Web

command-line-fundamentals/README.md at master - GitHub
The mkdir command is used to create a specified folder. If the specified folder already exists, it will not be overwritten. Moving and...
Read more >
How do I add an empty directory to a Git repository?
A simple solution to the "hidden problematic" is to name the file gitkeep (without the leading dot). We can take this one step...
Read more >
init/README.md
This approach ensures that the only service entries that init reads and the only actions that init performs correspond to services whose binaries...
Read more >
2.2 Git Basics - Recording Changes to the Repository
Let's change a file that was already tracked. · The CONTRIBUTING.md file appears under a section named “Changes not staged for commit” —...
Read more >
Working With Files and Directories – The Unix Shell
This happens because rm by default only works on files, not directories. rm can remove a directory and all its contents if we...
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