#!/usr/bin/env ruby require_relative "../lib/amazon_auth" require 'highline/import' result = [] login = ask("Enter your #{AmazonInfo.domain} username: ") { |q| q.echo = true } passwd = ask("Enter your #{AmazonInfo.domain} password: ") { |q| q.echo = "*" } salt = ask("Enter your salt: ") { |q| q.default = AmazonAuth::Converter.default_salt ; q.echo = true } raise "Empty login or password" if login.to_s.size == 0 || passwd.to_s.size == 0 converter = AmazonAuth::Converter.new(salt) puts "Put the following lines in .env" puts puts "AMAZON_USERNAME_CODE=#{converter.encode(login)}" puts "AMAZON_PASSWORD_CODE=#{converter.encode(passwd)}" puts "AMAZON_CODE_SALT=#{salt}"