From 64726aa073c9002828f63bde965964cff7cfbbee Mon Sep 17 00:00:00 2001 From: plugd Date: Thu, 15 Aug 2024 14:21:41 +0200 Subject: [PATCH] Allow building QWK packets without hello/goodbye/news --- README | 1 + qwikboard | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README b/README index 3b88d88..e9dc110 100644 --- a/README +++ b/README @@ -50,6 +50,7 @@ This command creates the board directory structure, including displayed to users by their offline mail reader when they open (hello) and close (goodbye) mail packets. An additional file (news) contains any board-wide news you'd like to distribute to your users. +(You can remove any of these notice files if they're not relevant.) Interacting with a message board -------------------------------- diff --git a/qwikboard b/qwikboard index cfa8a12..6724dfb 100755 --- a/qwikboard +++ b/qwikboard @@ -88,7 +88,12 @@ function fs.rmfile(filename) posix.unlink(filename) end -function fs.copy(filename, destfilename) +function fs.copy(filename, destfilename, skip_if_not_found) + + if skip_if_not_found and not fs.exists(filename) then + return + end + src = assert(io.open(filename,"r")) dest = assert(io.open(destfilename,"w")) @@ -163,9 +168,9 @@ function qwk.build_qwk(user_name, qwk_filename) -- Copy BBS welcome, news and goodbye files - fs.copy(qb.path .. "/notices/hello", work_dir .. "/HELLO") - fs.copy(qb.path .. "/notices/news", work_dir .. "/NEWS") - fs.copy(qb.path .. "/notices/goodbye", work_dir .. "/GOODBYE") + fs.copy(qb.path .. "/notices/hello", work_dir .. "/HELLO", true) + fs.copy(qb.path .. "/notices/news", work_dir .. "/NEWS", true) + fs.copy(qb.path .. "/notices/goodbye", work_dir .. "/GOODBYE", true) -- Pack messages -- 2.20.1