-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: download resources during runtime (#63)
* feat: download resources on the fly * refactor: simplify platform and arch selection * chore: typo * refactor: delete zip
- Loading branch information
Showing
55 changed files
with
193 additions
and
482 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { readFileSync, writeFileSync } from 'fs' | ||
import { v4 } from 'uuid' | ||
import { canResolvePath, resolvePath } from './path' | ||
import { checkPath, getPath } from './path' | ||
|
||
const API_KEY_FILE = 'api-key.txt' | ||
|
||
export function getApiKey() { | ||
if (!canResolvePath(API_KEY_FILE)) { | ||
if (!checkPath(API_KEY_FILE)) { | ||
const apiKey = v4() | ||
writeFileSync(resolvePath(API_KEY_FILE), apiKey) | ||
writeFileSync(getPath(API_KEY_FILE), apiKey) | ||
|
||
return apiKey | ||
} | ||
|
||
return readFileSync(resolvePath(API_KEY_FILE), 'utf-8') | ||
return readFileSync(getPath(API_KEY_FILE), 'utf-8') | ||
} |
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
Oops, something went wrong.