From: plugd Date: Thu, 15 Aug 2024 12:21:41 +0000 (+0200) Subject: Allow building QWK packets without hello/goodbye/news X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=64726aa073c9002828f63bde965964cff7cfbbee;p=qwikboard.git Allow building QWK packets without hello/goodbye/news --- 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