Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[#55] Add rake task to change project password.

* Add the rake task.
* Update the README.
* Fixes #55.
  • Loading branch information...
commit 295605d69a554c14268b1be08bcbfc1b302d4c79 1 parent 0022c84
@patricksrobertson patricksrobertson authored
Showing with 19 additions and 0 deletions.
  1. +5 −0 README.md
  2. +14 −0 lib/tasks/copycopter.rake
View
5 README.md
@@ -36,6 +36,11 @@ Adding a Project
heroku run rake copycopter:project NAME=Iora USERNAME=Copy PASSWORD=Copter
+Updating a Projects password
+----------------------------
+
+ heroku run rake copycopter:change_project_password NAME=IORA OLD=Copter NEW=COPTAH
+
Removing a Project
------------------
View
14 lib/tasks/copycopter.rake
@@ -24,4 +24,18 @@ namespace :copycopter do
puts "There were errors removing the project: #{project.errors.full_messages}"
end
end
+
+ desc 'Change the password of a Copycopter Project account'
+ task :change_project_password => :environment do
+ project = Project.where(:name => ENV['NAME']).first
+ old_password = project.password
+
+ project.password = ENV['NEW']
+
+ if ENV['OLD'] == old_password && project.save
+ puts "Project #{project.name} password has been updated!"
+ else
+ puts "You must know the old password to the project to update to the new password."
+ end
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.