-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
...and deprecate it upstream
- Loading branch information
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Foundation | ||
import Utils | ||
|
||
/// A wrapper around an executable node package that is located in the `Node` | ||
/// folder of this repository. | ||
public struct NodePackage { | ||
private let directoryURL: URL | ||
|
||
public init(name: String) { | ||
directoryURL = URL(fileURLWithPath: "Node/\(name)") | ||
} | ||
|
||
/// Invokes `npm start` with the given arguments. | ||
public func start(withArgs args: [String]) async throws -> Data { | ||
try await Shell().output(for: "npm", in: directoryURL, args: ["run", "--silent", "start", "--"] + args).get() | ||
} | ||
} |