Skip to content

Commit 8ad57d1

Browse files
committed
add: file path when recording log
1 parent ef072da commit 8ad57d1

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

cli.lua

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ end
4848

4949
print("")
5050
print("Rainy's android development tool: geta")
51-
print("--------------------------------------")
51+
print("---------------------------------------")
5252
print("Version | " .. package.version)
5353
print("Description | " .. package.description)
5454
print("License | " .. package.license)
55-
print("--------------------------------------")
55+
print("---------------------------------------")
5656
print("")
5757

5858
local accept = { 'dmesg', 'logcat', 'ramoops', 'clear', 'clearall' }
@@ -146,13 +146,17 @@ childprocess.exec('adb devices', function (_, res)
146146
end)
147147

148148
log(string.format('Device avaliable, now running log recorder... [%s]', mode))
149+
log(string.format('File avaliable in: %s', full_path))
149150

150151
local function run_dmesg_recorder(file)
151152
local childProcess = require('childprocess')
152153
local child = childProcess.spawn('adb', {'shell', 'su', '-c', 'dmesg', '-w'}, {})
153154
child.stdout:on('data', function (data)
154155
fs.writeSync(file, -1, data)
155156
end)
157+
child.stdout:on('close', function ()
158+
log('(FINISHED)')
159+
end)
156160
end
157161

158162
local function run_logcat_recorder(file)
@@ -161,6 +165,9 @@ local function run_logcat_recorder(file)
161165
child.stdout:on('data', function (data)
162166
fs.writeSync(file, -1, data)
163167
end)
168+
child.stdout:on('close', function ()
169+
log('(FINISHED)')
170+
end)
164171
end
165172

166173
local function run_ramoops_recorder(file)
@@ -170,7 +177,7 @@ local function run_ramoops_recorder(file)
170177
fs.writeSync(file, -1, data)
171178
end)
172179
child.stdout:on('close', function ()
173-
log(string.format('(FINISHED) File avaliable in: %s', full_path))
180+
log('(FINISHED)')
174181
end)
175182
end
176183

package.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
return {
22
name = "geta",
3-
version = "1.0.0",
3+
version = "1.0.1",
44
description = "A binary for getting logs",
55
tags = { "lua", "lit", "luvit" },
66
license = "BSD-2-Clause",
@@ -15,4 +15,3 @@
1515
"!*******-log"
1616
}
1717
}
18-

0 commit comments

Comments
 (0)