Sha256: 039f435d6d6029768ee04631f2ddc0ceaabebee551c107b0a66b3752ce27d672

Contents?: true

Size: 1007 Bytes

Versions: 6

Compression:

Stored size: 1007 Bytes

Contents

#!/usr/bin/env ruby
# encoding: utf-8

# Find version
version_file_path = File.expand_path('~/.nanoc-select-version')
if !File.exist?(version_file_path)
  warn 'WARNING: No nanoc version has been selected; using nanoc 3.x by default. Select a version using `nanoc-select` to make this warning go away.'
  version = 3
else
  version = File.read(version_file_path).to_i
end

# Determine nanoc executable name
VERSION_MAP = {
  2 => 'nanoc2',
  3 => 'nanoc3'
}
name = VERSION_MAP[version]
if name.nil?
  $stderr.puts "Unsupported nanoc version number: #{version}. Supported versions: #{VERSION_MAP.keys.join(', ')}."
  exit 1
end

# Run nanoc
begin
  exec name, *ARGV
rescue Errno::ENOENT
  $stderr.puts "Could not execute #{name}, which is your selected nanoc version. Make sure that #{name} is installed and that it is in your $PATH."
  $stderr.puts
  $stderr.puts "* To install #{name}, run `gem install #{name}`."
  $stderr.puts "* To select a different version of nanoc, run `nanoc-select`."
  exit 1
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
nanoc-3.1.2 bin/nanoc
nanoc-3.1.1 bin/nanoc
nanoc-3.1.0 bin/nanoc
nanoc-3.0.9 bin/nanoc
nanoc-3.0.0a2 bin/nanoc
nanoc-3.0.0a1 bin/nanoc