Sha256: 055fee51de90fc0b28713150256244d279dfc0ee643cd07dbe2a329f9466023b
Contents?: true
Size: 1.11 KB
Versions: 3
Compression:
Stored size: 1.11 KB
Contents
module Inertia module Generators module Helpers ### FS Helpers def js_destination_path return ViteRuby.config.source_code_dir if defined?(ViteRuby) if file?("config/vite.json") source_code_dir = JSON.parse(File.read(file_path("config/vite.json"))).dig("all", "sourceCodeDir") return source_code_dir if source_code_dir end "app/frontend" end def js_destination_root file_path(js_destination_path) end def js_file_path(*relative_path) File.join(js_destination_root, *relative_path) end def file?(*relative_path) File.file?(file_path(*relative_path)) end def file_path(*relative_path) File.join(destination_root, *relative_path) end # Interactivity Helpers def ask(*) unless options[:interactive] say_error "Specify all options when running the generator non-interactively.", :red exit(1) end super end def yes?(*) return false unless options[:interactive] super end end end end
Version data entries
3 entries across 3 versions & 1 rubygems