From 4b7e8b6a3776fbb286e16236a77601f952918a0b Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Wed, 13 Feb 2013 12:24:15 -0800 Subject: [PATCH] Clean up .atom creation --- Rakefile | 42 ++++-------------------- {.atom => dot-atom}/config.cson | 0 {.atom => dot-atom}/packages/README.md | 0 {.atom => dot-atom}/snippets/coffee.cson | 0 {.atom => dot-atom}/themes/README.md | 0 {.atom => dot-atom}/user.coffee | 0 {.atom => dot-atom}/user.css | 0 7 files changed, 7 insertions(+), 35 deletions(-) rename {.atom => dot-atom}/config.cson (100%) rename {.atom => dot-atom}/packages/README.md (100%) rename {.atom => dot-atom}/snippets/coffee.cson (100%) rename {.atom => dot-atom}/themes/README.md (100%) rename {.atom => dot-atom}/user.coffee (100%) rename {.atom => dot-atom}/user.css (100%) diff --git a/Rakefile b/Rakefile index 4a496c208..a1fc2a4bb 100644 --- a/Rakefile +++ b/Rakefile @@ -35,15 +35,8 @@ task :install => [:clean, :build] do `cp -r #{path} #{File.expand_path(dest)}` # Install cli atom - usr_bin_path = default_usr_bin_path = "/opt/github/bin" + usr_bin_path = "/opt/github/bin" cli_path = "#{usr_bin_path}/atom" - stable_cli_path = "#{usr_bin_path}/atom-stable" - `echo "use 'atom --stable' in place of atom-stable." > #{stable_cli_path}` - - if !File.exists?(usr_bin_path) - $stderr.puts "ERROR: Failed to install atom cli tool at '#{usr_bin_path}'" - exit 1 - end template = ERB.new CLI_SCRIPT namespace = OpenStruct.new(:application_path => dest, :resource_path => ATOM_SRC_PATH) @@ -55,27 +48,12 @@ task :install => [:clean, :build] do Rake::Task["create-dot-atom"].invoke() Rake::Task["clone-default-bundles"].invoke() - puts "\033[32mType `atom` to start Atom! In Atom press `cmd-,` to edit your `.atom` directory\033[0m" + puts "\033[32mType `atom` to start Atom! In Atom press `cmd-,` to edit your `~/.atom` directory\033[0m" end 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.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" - end - end - - # Migration: remove files that are no longer needed - `rm -rf #{File.join(DOT_ATOM_PATH, 'default-config.coffee')}` - - dot_atom_template_path = ATOM_SRC_PATH + "/.atom" - replace_dot_atom = false + dot_atom_template_path = ATOM_SRC_PATH + "/dot-atom" if File.exists?(DOT_ATOM_PATH) user_config = "#{DOT_ATOM_PATH}/user.coffee" @@ -85,17 +63,11 @@ task "create-dot-atom" do `mv #{old_user_config} #{user_config}` puts "\033[32mRenamed #{old_user_config} to #{user_config}\033[0m" end - - next + else + `mkdir "#{DOT_ATOM_PATH}"` + `cp -r "#{dot_atom_template_path}/" "#{DOT_ATOM_PATH}"/` + `cp -r "#{ATOM_SRC_PATH}/themes/" "#{DOT_ATOM_PATH}"/themes/` end - - `rm -rf "#{DOT_ATOM_PATH}"` - `mkdir "#{DOT_ATOM_PATH}"` - - `cp "#{dot_atom_template_path}/user.coffee" "#{DOT_ATOM_PATH}"` - `cp "#{dot_atom_template_path}/user.css" "#{DOT_ATOM_PATH}"` - `cp -r "#{dot_atom_template_path}/packages" "#{DOT_ATOM_PATH}"` - `cp -r "#{ATOM_SRC_PATH}/themes" "#{DOT_ATOM_PATH}"` end desc "Clone default bundles into vendor/bundles directory" diff --git a/.atom/config.cson b/dot-atom/config.cson similarity index 100% rename from .atom/config.cson rename to dot-atom/config.cson diff --git a/.atom/packages/README.md b/dot-atom/packages/README.md similarity index 100% rename from .atom/packages/README.md rename to dot-atom/packages/README.md diff --git a/.atom/snippets/coffee.cson b/dot-atom/snippets/coffee.cson similarity index 100% rename from .atom/snippets/coffee.cson rename to dot-atom/snippets/coffee.cson diff --git a/.atom/themes/README.md b/dot-atom/themes/README.md similarity index 100% rename from .atom/themes/README.md rename to dot-atom/themes/README.md diff --git a/.atom/user.coffee b/dot-atom/user.coffee similarity index 100% rename from .atom/user.coffee rename to dot-atom/user.coffee diff --git a/.atom/user.css b/dot-atom/user.css similarity index 100% rename from .atom/user.css rename to dot-atom/user.css