allow env variables expansion in config files
This commit is contained in:
@@ -82,6 +82,7 @@ extension PHBlock {
|
||||
guard kind == .text else { return nil }
|
||||
|
||||
let command = command
|
||||
let environment = self.environment
|
||||
|
||||
let lines: [Substring]? = await Task.detached(priority: .userInitiated) {
|
||||
let process = Process()
|
||||
@@ -92,8 +93,9 @@ extension PHBlock {
|
||||
process.executableURL = URL(fileURLWithPath: "/bin/bash")
|
||||
process.arguments = ["-c", command]
|
||||
|
||||
// Inherit the parent's environment (includes $PATH, etc.)
|
||||
process.environment = ProcessInfo.processInfo.environment
|
||||
// Scripts inherit phbar's process environment with the `[env]` section
|
||||
// overlaid, so user-defined variables and PATH extensions are visible.
|
||||
process.environment = environment.variables
|
||||
if let gestureEvent {
|
||||
let type = gestureEvent.type.rawValue
|
||||
process.environment?.updateValue(type, forKey: PHGestureEvent.typeKey)
|
||||
|
||||
Reference in New Issue
Block a user