Fix bug in main.arguments
Process.arguments is never empty as the first item is always the path of the script. Except for in a playground where it actually is empty.
This commit is contained in:
@@ -52,7 +52,8 @@ public final class MainShellContext: ShellContextType {
|
||||
}
|
||||
}
|
||||
|
||||
public lazy var arguments: [String] = Process.arguments.isEmpty ? [] : Array(Process.arguments.dropFirst())
|
||||
|
||||
public lazy var arguments: [String] = Process.arguments.count <= 1 ? [] : Array(Process.arguments.dropFirst())
|
||||
public lazy var name: String = Process.arguments.first.map(NSURL.init)?.lastPathComponent ?? ""
|
||||
|
||||
private init() {
|
||||
|
||||
Reference in New Issue
Block a user