Commit 168aa5fe authored by Kaarle Ritvanen's avatar Kaarle Ritvanen
Browse files

util: startswithupper function

parent ae381965
......@@ -602,8 +602,9 @@ end
function M.Rule:customtarget()
if self.action then
local as = self.action:sub(1, 1)
if as == as:upper() or startswith(self.action, 'custom:') then
if util.startswithupper(self.action) or startswith(
self.action, 'custom:'
) then
return self.action
Utility module for Alpine Wall
Copyright (C) 2012-2019 Kaarle Ritvanen
Copyright (C) 2012-2020 Kaarle Ritvanen
See LICENSE file for license details
......@@ -121,6 +121,12 @@ function M.join(a, sep, b)
function M.startswithupper(s)
if s == '' then return false end
local c = s:sub(1, 1)
return c == c:upper()
function M.quote(s) return '"'..s:gsub('(["\\])', '\\%1')..'"' end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment