mpvScripts.buildLua: Strip pname
when inferring scriptName
This commit is contained in:
parent
eab72db9b0
commit
4db7046b7f
@ -20,11 +20,17 @@ lib.makeOverridable (args: stdenvNoCC.mkDerivation (extendedBy
|
||||
, extraScripts ? []
|
||||
, ... }@args:
|
||||
let
|
||||
strippedName = with builtins;
|
||||
let groups = match "mpv[-_](.*)" pname; in
|
||||
if groups != null
|
||||
then head groups
|
||||
else pname
|
||||
;
|
||||
# either passthru.scriptName, inferred from scriptPath, or from pname
|
||||
scriptName = (args.passthru or {}).scriptName or (
|
||||
if args ? scriptPath
|
||||
then fileName args.scriptPath
|
||||
else "${pname}.lua"
|
||||
else "${strippedName}.lua"
|
||||
);
|
||||
scriptPath = args.scriptPath or "./${scriptName}";
|
||||
in {
|
||||
|
Loading…
Reference in New Issue
Block a user