class Fastlane::Helper::CreatorHelper
Public Class Methods
ensure_creator_exists()
click to toggle source
# File lib/fastlane/plugin/creator/helper/creator_helper.rb, line 8 def self.ensure_creator_exists if !self.which("creator").nil? return "creator" elsif !self.which("cargo-creator").nil? return "cargo-creator" else return nil end end
find_default_rust_project()
click to toggle source
Find any existing Rust project
# File lib/fastlane/plugin/creator/helper/creator_helper.rb, line 35 def self.find_default_rust_project Dir["./*.toml"].last || nil end
which(cmd)
click to toggle source
Cross-platform way of finding an executable in the $PATH.
which('ruby') #=> /usr/bin/ruby
# File lib/fastlane/plugin/creator/helper/creator_helper.rb, line 21 def self.which(cmd) exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : [''] ENV['PATH'].split(File::PATH_SEPARATOR).each do |path| exts.each do |ext| exe = File.join(path, "#{cmd}#{ext}") return exe if File.executable?(exe) && !File.directory?(exe) end end nil end