mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2025-12-06 06:36:15 +00:00
Matugen: improved wallpaper filepath escaping to ensure it works well with potential non standard characters.
This commit is contained in:
@@ -176,10 +176,13 @@ Singleton {
|
||||
function buildMatugenScript(content, wallpaper, mode) {
|
||||
const delimiter = "MATUGEN_CONFIG_EOF_" + Math.random().toString(36).substr(2, 9);
|
||||
const pathEsc = dynamicConfigPath.replace(/'/g, "'\\''");
|
||||
const wpDelimiter = "WALLPAPER_PATH_EOF_" + Math.random().toString(36).substr(2, 9);
|
||||
|
||||
// Use heredoc for wallpaper path to avoid all escaping issues
|
||||
let script = `cat > '${pathEsc}' << '${delimiter}'\n${content}\n${delimiter}\n`;
|
||||
script += `matugen image '${wallpaper}' --config '${pathEsc}' --mode ${mode} --type ${Settings.data.colorSchemes.matugenSchemeType}`;
|
||||
script += buildUserTemplateCommand(wallpaper, mode);
|
||||
script += `NOCTALIA_WP_PATH=$(cat << '${wpDelimiter}'\n${wallpaper}\n${wpDelimiter}\n)\n`;
|
||||
script += `matugen image "$NOCTALIA_WP_PATH" --config '${pathEsc}' --mode ${mode} --type ${Settings.data.colorSchemes.matugenSchemeType}`;
|
||||
script += buildUserTemplateCommand("$NOCTALIA_WP_PATH", mode);
|
||||
|
||||
return script + "\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user