mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
feat: add current working directory to path api module (#1375)
This commit is contained in:
@@ -18,7 +18,8 @@ export enum BaseDirectory {
|
||||
Template,
|
||||
Video,
|
||||
Resource,
|
||||
App
|
||||
App,
|
||||
Current
|
||||
}
|
||||
|
||||
export interface FsOptions {
|
||||
|
||||
@@ -289,6 +289,22 @@ async function videoDir(): Promise<string> {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @name currentDir
|
||||
* @descriptionReturns Returns the path to the current working dir.
|
||||
* @return {Promise<string>}
|
||||
*/
|
||||
async function currentDir(): Promise<string> {
|
||||
return invokeTauriCommand<string>({
|
||||
__tauriModule: 'Fs',
|
||||
message: {
|
||||
cmd: 'resolvePath',
|
||||
path: '',
|
||||
directory: BaseDirectory.Current
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @name resolvePath
|
||||
* @descriptionReturns Resolves the path with the optional base directory.
|
||||
@@ -327,5 +343,6 @@ export {
|
||||
runtimeDir,
|
||||
templateDir,
|
||||
videoDir,
|
||||
currentDir,
|
||||
resolvePath
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user