Skip to content

Installation problem (brew) #4

@eralnar

Description

@eralnar

image

### Rakefile:

require 'open3'

task default: %w[setup]

task :setup => [:brew, :precommit]

task(:brew) do

  raise '`brew` is required. Please install brew. https://brew.sh/' unless system('which brew')

  puts('➡️  Brew')
  sh('brew bundle')

  puts('➡️  Bundle')
  sh('bundle install')

  puts('➡️  Cocoapods')
  sh('bundle exec pod install')
end

task(:precommit) do
  puts('Deleting other installed hooks to avoid collision...')
  puts('Checking overcommit installation...')
  if system('which overcommit')
    puts('Found system-wide overcommit installation, uninstalling hooks...')
    stdout, _, _ = Open3.capture3('overcommit --uninstall')
    puts(stdout) unless stdout.empty?
  elsif system('bundle show overcommit')
    puts('Found bundle-wide overcommit installation, uninstalling hooks...')
    stdout, _, _ = Open3.capture3('overcommit --uninstall')
    puts(stdout) unless stdout.empty?
  end
  puts('➡️  pre-commit 👮‍♀️')
  sh('pre-commit install -f')
  sh('pre-commit install --hook-type commit-msg')
end

task(:docs) do
  sh('sourcedocs generate --min-acl public --output-folder Docs -- -workspace REDACTED.xcworkspace -scheme REDACTED-Release')
  sh('moduleinterface generate --min-acl public --output-folder Docs -- -workspace REDACTED.xcworkspace -scheme REDACTED-Release')
end

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions