Commit: 78da00c1cb21c61fd4a9a38d738b92fe90937f47
Parent: 31fd9402addbe3d3374c0c84181752b309d4b087
Author: Ren Tatsumoto
Date: Thu, 10 Sep 2020 20:53:01 +0300
style
Diffstat:
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/subs2srs.lua b/subs2srs.lua
@@ -206,15 +206,14 @@ local function anki_compatible_length(str)
-- anki forcibly mutilates all filenames longer than 64 characters
-- leave 25 characters for the filename
-- the rest is reserved for the timestamp, which is added later
- local args = {
+
+ local ret = subprocess {
'awk',
'-v', string.format('str=%s', str),
'-v', 'limit=25',
'BEGIN{print substr(str, 1, limit); exit}'
}
- local ret = subprocess(args)
-
if ret.status == 0 then
ret.stdout = remove_newlines(ret.stdout)
ret.stdout = remove_leading_trailing_spaces(ret.stdout)
@@ -852,7 +851,9 @@ end
------------------------------------------------------------
-- main
-if config.autoclip == true then clip_autocopy.enable() end
+if config.autoclip == true then
+ clip_autocopy.enable()
+end
check_config_sanity()
ankiconnect.create_deck_if_doesnt_exist(config.deck_name)