-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add CLI command to open Sanity Learn (#7409)
- Loading branch information
1 parent
b693396
commit 1504511
Showing
2 changed files
with
22 additions
and
0 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,20 @@ | ||
import open from 'open' | ||
|
||
import {type CliCommandDefinition} from '../../types' | ||
|
||
const learnCommand: CliCommandDefinition = { | ||
name: 'learn', | ||
helpText: '', | ||
signature: 'learn', | ||
description: 'Opens Sanity Learn in your web browser', | ||
async action(args, context) { | ||
const {output} = context | ||
const {print} = output | ||
const url = 'https://www.sanity.io/learn' | ||
|
||
print(`Opening ${url}`) | ||
await open(url) | ||
}, | ||
} | ||
|
||
export default learnCommand |