twenty-cli 0.5.5 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11aeb74ec54a850fe0d39de13bb11c4da47e452e4e27adb7eb43dc69f6c7237c
|
4
|
+
data.tar.gz: 7ae6e0a4e454e395cd4eb4a60e7fb446099cc19c8bcda15e11d7533e21abbaec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c30f12237301803e9502f97a1ea1f7fe845f0232acbb77b2a7093007fe5b4e0e5279d088f696b6144402246be56a0c5d43bf7a993a791f50e3cf5e0fcef9ccb0
|
7
|
+
data.tar.gz: a23b70eef9714a4ef3a63f30c6c0b39aadd4ba9434fcbe6713196b66734f3dcb2c7ceca9530a88e80dca176cb6caf3ffac831203452b253a6cd32b53358420af
|
@@ -2,11 +2,12 @@
|
|
2
2
|
|
3
3
|
module Twenty::Command::Hook
|
4
4
|
module RequireMigration
|
5
|
+
Error = Class.new(RuntimeError)
|
6
|
+
|
5
7
|
def run_command(...)
|
6
8
|
if pending_migrations?
|
7
|
-
|
8
|
-
|
9
|
-
exit(1)
|
9
|
+
raise Error, "There are pending database migrations to run. \n" \
|
10
|
+
"Try 'twenty migrate'"
|
10
11
|
else
|
11
12
|
super(...)
|
12
13
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module Twenty::Command::Hook
|
4
4
|
module Rescue
|
5
5
|
FRAME_MAX = 15
|
6
|
+
INDENT_BY = 2
|
6
7
|
|
7
8
|
def run(...)
|
8
9
|
super(...)
|
@@ -11,7 +12,8 @@ module Twenty::Command::Hook
|
|
11
12
|
$stderr.print "\n",
|
12
13
|
" ", Paint[" Exception ", :white, :red, :bold], "\n",
|
13
14
|
" ", Paint[ex.class.to_s, :bold], "\n",
|
14
|
-
|
15
|
+
ex.message.each_line.map { [" " * INDENT_BY, _1] }.join,
|
16
|
+
"\n\n",
|
15
17
|
" ", Paint[" Backtrace ", :white, :blue, :bold], "\n",
|
16
18
|
format_backtrace(ex.backtrace), "\n",
|
17
19
|
"\n"
|
@@ -20,8 +22,8 @@ module Twenty::Command::Hook
|
|
20
22
|
private
|
21
23
|
|
22
24
|
def format_backtrace(backtrace)
|
23
|
-
backtrace
|
24
|
-
"
|
25
|
+
backtrace[0..FRAME_MAX-1].map do
|
26
|
+
[" " * INDENT_BY, _1.gsub(Dir.getwd, "")].join
|
25
27
|
end.join("\n")
|
26
28
|
end
|
27
29
|
end
|