-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
122 additions
and
3 deletions.
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,35 @@ | ||
/* | ||
* Copyright (C) 2024 Nameless Production Committee | ||
* | ||
* Licensed under the MIT License (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://opensource.org/licenses/mit-license.php | ||
*/ | ||
package bee.task; | ||
|
||
import bee.Platform; | ||
import bee.Task; | ||
import bee.api.Command; | ||
import bee.util.Process; | ||
|
||
public class Bun extends Task { | ||
|
||
@Command("Install bun.") | ||
public void install() { | ||
if (Process.isAvailable("bun")) { | ||
ui.info("Bun [", Process.with().read("bun -v"), "] is already installed."); | ||
} else { | ||
Process.with() | ||
.inheritIO() | ||
.when(Platform::isWindows, "powershell -c \"irm bun.sh/install.ps1|iex\"") | ||
.run("curl -fsSL https://bun.sh/install | bash"); | ||
} | ||
} | ||
|
||
@Command("Launch development server.") | ||
public void dev() { | ||
Process.with().inheritIO().run("bun run dev"); | ||
} | ||
} |
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