Class: Slugforge::Build::BuildProject

Inherits:
Slugforge::BuildCommand show all
Defined in:
lib/slugforge/build/build_project.rb

Instance Method Summary collapse

Methods inherited from Slugforge::BuildCommand

inherited

Methods inherited from Command

#initialize, start

Methods included from Helper

included

Constructor Details

This class inherits a constructor from Slugforge::Command

Instance Method Details

#callObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/slugforge/build/build_project.rb', line 5

def call
  unless File.exists?(build_script)
    logger.say_status :missing, build_script, :yellow
    return true
  end

  logger.say_status :run, build_script
  inside(project_root) do
    with_gemfile(project_path('Gemfile')) do
      
      FileUtils.chmod("+x", build_script)
      unless execute(build_script)
        raise error_class, "build script #{build_script} failed"
      end
    end
  end
end