-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api/path): introduce well known path constants
- Loading branch information
Showing
6 changed files
with
295 additions
and
7 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
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,48 @@ | ||
import ipc from '../ipc.js' | ||
|
||
const paths = ipc.sendSync('os.paths') | ||
|
||
/** | ||
* Well known path to the user's "Downloads" folder. | ||
* @type {?string} | ||
*/ | ||
export const DOWNLOADS = paths.data.downloads || null | ||
|
||
/** | ||
* Well known path to the user's "Documents" folder. | ||
* @type {?string} | ||
*/ | ||
export const DOCUMENTS = paths.data.documents || null | ||
|
||
/** | ||
* Well known path to the user's "Pictures" folder. | ||
* @type {?string} | ||
*/ | ||
export const PICTURES = paths.data.pictures || null | ||
|
||
/** | ||
* Well known path to the user's "Desktop" folder. | ||
* @type {?string} | ||
*/ | ||
export const DESKTOP = paths.data.desktop || null | ||
|
||
/** | ||
* Well known path to the user's "Videos" folder. | ||
* @type {?string} | ||
*/ | ||
export const VIDEOS = paths.data.videos || null | ||
|
||
/** | ||
* Well known path to the user's "Music" folder. | ||
* @type {?string} | ||
*/ | ||
export const MUSIC = paths.data.music || null | ||
|
||
export default { | ||
DOWNLOADS, | ||
DOCUMENTS, | ||
PICTURES, | ||
DESKTOP, | ||
VIDEOS, | ||
MUSIC | ||
} |
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