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

(ruby2.devkit) ruby2.devkit does not preserve config.yml #182

Open
brianrobertarmstrong opened this issue Sep 18, 2016 · 1 comment
Open

Comments

@brianrobertarmstrong
Copy link

ruby2.devkit tries to prevent an existing config.yml file from being overwritten

  # clean out the recommended directories
  #2. Delete all the <DEVKIT_INSTALL_DIR> subdirectories and files except for config.yml. If you’ve made any customizations to the MSYS shell you may also want to keep files in the etc and home subdirectories.
  if ([System.IO.File]::Exists("$($devKitInstallDir)\config.yml")) {
    Write-Host "Moving config.yml to a holding location prior to extraction"
    Copy-Item "$($devKitInstallDir)\config.yml" "$tempDir" -Force
  }

It then copes the config.yml file back to $devKitInstallDir after extracting the installer archive.
But later on when the package runs ruby dk.rb init the installer will overwrite config.yml anyway, blowing away your changes:

  def self.init
    # get all known installed Ruby root dirs and write the root dirs
    # to 'config.yml', overwriting any existing config file.
    ir = installed_rubies

So it seems to me that you always end up with the auto-generated config.yml based on the registry key search. I don't know if it would make sense to have the copy happen after dk.rb init instead? That might also lead to surprising behavior.

@ferventcoder ferventcoder changed the title ruby2.devkit does not preserve config.yml (ruby2.devkit) ruby2.devkit does not preserve config.yml Nov 28, 2016
@ferventcoder
Copy link
Owner

I thought dk init needed force to blow away the changes.

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

No branches or pull requests

2 participants