Skip to content

Commit

Permalink
Replace LuckyCli with LuckyTask (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewmcgarvey authored Apr 4, 2021
1 parent bc41988 commit 07067ca
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 15 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ jobs:
key: ${{ runner.os }}-crystal
- name: Install shards
run: shards install
- name: Install Lucky CLI
run: |
crystal build lib/lucky_cli/src/lucky.cr --no-debug --release
cp lucky /usr/local/bin
- name: Run integration test
run: ./script/integration_test
env:
Expand Down
4 changes: 3 additions & 1 deletion script/integration_test
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -e

printf "\nRunning tasks\n\n"

alias lucky="crystal tasks.cr"

lucky db.drop
lucky db.create
lucky db.migrate
Expand All @@ -23,4 +25,4 @@ then
lucky db.reset
lucky db.drop
lucky db.setup
fi
fi
4 changes: 2 additions & 2 deletions shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ authors:
- Paul Smith <[email protected]>

dependencies:
lucky_cli:
github: luckyframework/lucky_cli
lucky_task:
github: luckyframework/lucky_task
branch: master
pg:
github: will/crystal-pg
Expand Down
1 change: 0 additions & 1 deletion src/avram.cr
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require "dexter"
require "lucky_cli"
require "wordsmith"
require "habitat"
require "pulsar"
Expand Down
3 changes: 2 additions & 1 deletion src/avram/migrator/runner.cr
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
require "db"
require "pg"
require "colorize"
require "lucky_task"

class Avram::Migrator::Runner
MIGRATIONS_TABLE_NAME = "migrations"

extend LuckyCli::TextHelpers
extend LuckyTask::TextHelpers

@@migrations = [] of Avram::Migrator::Migration::V1.class

Expand Down
2 changes: 1 addition & 1 deletion src/avram/tasks/db/base_task.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
abstract class BaseTask < LuckyCli::Task
abstract class BaseTask < LuckyTask::Task
abstract def run_task

def call
Expand Down
2 changes: 1 addition & 1 deletion src/avram/tasks/db/console.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Db::Console < LuckyCli::Task
class Db::Console < LuckyTask::Task
summary "Access PostgreSQL console"

def help_message
Expand Down
4 changes: 2 additions & 2 deletions src/avram/tasks/gen/migration.cr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require "ecr"
require "file_utils"

class Avram::Migrator::MigrationGenerator
include LuckyCli::TextHelpers
include LuckyTask::TextHelpers

getter :name
@_version : String?
Expand Down Expand Up @@ -105,7 +105,7 @@ class Avram::Migrator::MigrationGenerator
end
end

class Gen::Migration < LuckyCli::Task
class Gen::Migration < LuckyTask::Task
summary "Generate a new migration"

Habitat.create do
Expand Down
4 changes: 2 additions & 2 deletions tasks.cr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "lucky_cli"
require "lucky_task"
require "./src/avram"
require "./config/*"
require "./db/migrations/*"

Habitat.raise_if_missing_settings!
LuckyCli::Runner.run
LuckyTask::Runner.run

0 comments on commit 07067ca

Please sign in to comment.