Sha256: 9449134b36b5c86243f094efc574dd360f8cc7c58d04e8864a4e3ab95577933c
Contents?: true
Size: 1.05 KB
Versions: 45
Compression:
Stored size: 1.05 KB
Contents
require 'fileutils' module Prick::SubCommand def self.init(dir, name, title, database, username) if dir !File.exist?(dir) or raise Prick::Error, "Directory #{dir} exists" FileUtils.mkdir_p(dir) Dir.chdir(dir) else dir = "." end name ||= File.basename(Dir.getwd) title ||= name database ||= name username ||= name Command.command %( git init . cp -a #{SHARE_PATH}/init/. . git add . git commit -am "Initial import" ), fail: false Command.status == 0 or raise Prick::Fail, "Init script failed" state = State.new state.name = name state.title = title state.prick_version = PrickVersion.new VERSION state.version = PrickVersion.new("0.0.0") state.environment = :development state.database = database state.username = username state.save Command.command %( set -e git commit -am "Release 0.0.0" git tag v0.0.0 ), fail: false Command.status == 0 or raise Prick::Fail, "Init script failed" [dir, state] end end
Version data entries
45 entries across 45 versions & 1 rubygems