Sha256: 75691e949b561d71a5a60914df0b03eb77ac07da29ce2dc69b5709f478cdab13
Contents?: true
Size: 1.06 KB
Versions: 12
Compression:
Stored size: 1.06 KB
Contents
# frozen_string_literal: true require 'rake_factory' require 'ruby_npm' require_relative '../mixins/directoried' module RakeNPM module Tasks class RunScript < RakeFactory::Task include Mixins::Directoried default_name :run_script default_description(RakeFactory::DynamicValue.new do |t| "Runs the NPM #{t.script} script" end) parameter :script, required: true parameter :arguments parameter :color, default: 'always' parameter :environment, default: {} parameter :directory action do |task| logged_directory = task.directory || '.' puts( "Running NPM script: '#{task.script}' " \ "in directory: '#{logged_directory}'..." ) in_directory(task.directory) do RubyNPM.run_script( { script: task.script, arguments: task.arguments, color: task.color }, { environment: task.environment } ) end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems