lib/licensee/commands/license_path.rb in licensee-9.16.0 vs lib/licensee/commands/license_path.rb in licensee-9.16.1
- old
+ new
@@ -1,16 +1,16 @@
# frozen_string_literal: true
class LicenseeCLI < Thor
desc 'license-path [PATH]', "Returns the path to the given project's license file"
- def license_path(_path)
- if project.license_file
- if remote?
- say project.license_file.path
- else
- say File.expand_path project.license_file.path
- end
+ def license_path(path)
+ project = Licensee.project(path)
+
+ exit 1 unless project.license_file
+
+ if remote?
+ say project.license_file.path
else
- exit 1
+ say File.expand_path(project.license_file.path, path)
end
end
end