diff --git a/tasks/release.rb b/tasks/release.rb index ad1c5ecb2c..345ad7ea02 100644 --- a/tasks/release.rb +++ b/tasks/release.rb @@ -99,12 +99,26 @@ npm_version = version.gsub(/\./).with_index { |s, i| i >= 2 ? "-" : s } end task push: :build do - sh "gem push #{gem}" + otp = "" + begin + otp = " --otp " + `ykman oath accounts code -s rubygems.org`.chomp + rescue + # User doesn't have ykman + end + + sh "gem push #{gem}#{otp}" if File.exist?("#{framework}/package.json") Dir.chdir("#{framework}") do npm_tag = /[a-z]/.match?(version) ? "pre" : "latest" - sh "npm publish --tag #{npm_tag}" + npm_otp = "" + begin + npm_otp = " --otp " + `ykman oath accounts code -s npmjs.com`.chomp + rescue + # User doesn't have ykman + end + + sh "npm publish --tag #{npm_tag}#{npm_otp}" end end end