Move all bundles in ~/.atom/bundles to packages if that dir exists

This fixes a bug where we always moved the `bundles` dir inside the
`packages` dir if it existed, which caused a load error trying to load
the `bundles` dir as if it were a package.
This commit is contained in:
Nathan Sobo
2012-12-31 12:40:39 -06:00
parent e11c7e21fb
commit 2b6ee54a81

View File

@@ -62,9 +62,9 @@ desc "Creates .atom file if non exists"
task "create-dot-atom" do
# Migration: If there is still a bundle path, rename it to packages
if File.exists?(DOT_ATOM_PATH) and File.exists?(File.join(DOT_ATOM_PATH, "bundles"))
if File.join(DOT_ATOM_PATH, "packages")
`rm #{File.join(DOT_ATOM_PATH, "bundles")}`
$stderr.puts "WARNING: removed ~/.atom/bundles"
if File.exists?(File.join(DOT_ATOM_PATH, "packages"))
`mv #{File.join(DOT_ATOM_PATH, "bundles", "*")} #{File.join(DOT_ATOM_PATH, "packages")}`
$stderr.puts "WARNING: Bundles from ~/.atom/bundles were moved to ~/.atom/packages"
else
`mv #{File.join(DOT_ATOM_PATH, "bundles")} #{File.join(DOT_ATOM_PATH, "packages")}`
$stderr.puts "WARNING: ~/.atom/bundles was moved to ~/.atom/packages"