Clean up .atom creation
Esse commit está contido em:
+7
-35
@@ -35,15 +35,8 @@ task :install => [:clean, :build] do
|
|||||||
`cp -r #{path} #{File.expand_path(dest)}`
|
`cp -r #{path} #{File.expand_path(dest)}`
|
||||||
|
|
||||||
# Install cli atom
|
# 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"
|
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
|
template = ERB.new CLI_SCRIPT
|
||||||
namespace = OpenStruct.new(:application_path => dest, :resource_path => ATOM_SRC_PATH)
|
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["create-dot-atom"].invoke()
|
||||||
Rake::Task["clone-default-bundles"].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
|
end
|
||||||
|
|
||||||
desc "Creates .atom file if non exists"
|
desc "Creates .atom file if non exists"
|
||||||
task "create-dot-atom" do
|
task "create-dot-atom" do
|
||||||
# Migration: If there is still a bundle path, rename it to packages
|
dot_atom_template_path = ATOM_SRC_PATH + "/dot-atom"
|
||||||
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
|
|
||||||
|
|
||||||
if File.exists?(DOT_ATOM_PATH)
|
if File.exists?(DOT_ATOM_PATH)
|
||||||
user_config = "#{DOT_ATOM_PATH}/user.coffee"
|
user_config = "#{DOT_ATOM_PATH}/user.coffee"
|
||||||
@@ -85,17 +63,11 @@ task "create-dot-atom" do
|
|||||||
`mv #{old_user_config} #{user_config}`
|
`mv #{old_user_config} #{user_config}`
|
||||||
puts "\033[32mRenamed #{old_user_config} to #{user_config}\033[0m"
|
puts "\033[32mRenamed #{old_user_config} to #{user_config}\033[0m"
|
||||||
end
|
end
|
||||||
|
else
|
||||||
next
|
`mkdir "#{DOT_ATOM_PATH}"`
|
||||||
|
`cp -r "#{dot_atom_template_path}/" "#{DOT_ATOM_PATH}"/`
|
||||||
|
`cp -r "#{ATOM_SRC_PATH}/themes/" "#{DOT_ATOM_PATH}"/themes/`
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
desc "Clone default bundles into vendor/bundles directory"
|
desc "Clone default bundles into vendor/bundles directory"
|
||||||
|
|||||||
Referência em uma Nova Issue
Bloquear um usuário