Skip to content

Commit a4b2049

Browse files
author
Olivier Bonnaure
committedMar 14, 2024
fix: add context to files created
1 parent b560026 commit a4b2049

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎beans.lua

+8-1
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,16 @@ CreateController = function(controller_name)
6666
template = ProcessTemplate(template, words)
6767
Barf("app/controllers/" .. words.plural .. "_controller.lua", template)
6868
Barf("specs/controllers/" .. words.plural .. "_spec.lua", spec)
69+
print("✅ app/controller/" .. words.plural .. "_controller.lua created")
70+
print("✅ specs/controllers/" .. words.plural .. "_spec.lua created")
6971
end
7072

7173
CreateMigration = function(name)
7274
local words = DefineWords(name)
7375
local template = Slurp(".templates/migration.lua")
7476
template = ProcessTemplate(template, words)
7577
Barf("migrations/" .. os.date("%Y%m%d-%H%I%S_") .. Slugify(name) .. ".lua", template)
78+
print("✅ migrations/" .. os.date("%Y%m%d-%H%I%S_") .. Slugify(name) .. ".lua created")
7679
end
7780

7881
CreateModel = function(model_name)
@@ -83,9 +86,12 @@ CreateModel = function(model_name)
8386
Barf("app/models/" .. words.singular .. ".lua", template)
8487
Barf("specs/models/" .. words.singular .. "_spec.lua", spec)
8588
CreateMigration("create " .. words.plural .. " table")
89+
print("✅ app/models/" .. words.singular .. ".lua created")
90+
print("✅ specs/models/" .. words.singular .. "_spec.lua created")
8691
end
8792

8893
if arg[1] == "create" then
94+
print("create")
8995
if arg[2] == "migration" then
9096
CreateMigration(arg[3])
9197
end
@@ -99,8 +105,9 @@ if arg[1] == "create" then
99105
end
100106

101107
if arg[2] == "scaffold" then
108+
print("scaffold")
102109
singular = Singularize(arg[3])
103-
110+
print(singular)
104111
CreateController(singular)
105112
CreateView(singular)
106113
CreateModel(singular)

0 commit comments

Comments
 (0)
Please sign in to comment.