• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript fs-extra-promise.lstatAsync函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中fs-extra-promise.lstatAsync函数的典型用法代码示例。如果您正苦于以下问题:TypeScript lstatAsync函数的具体用法?TypeScript lstatAsync怎么用?TypeScript lstatAsync使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了lstatAsync函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: getLaunchFilePath

function getLaunchFilePath(filePathOrFolder: string): Promise<string> {
    return fs.lstatAsync(filePathOrFolder).then(stats => {
        // If a file path was passed, assume its the launch file.
        if (stats.isFile()) {
            return filePathOrFolder;
        }

        // Otherwise, search the specified folder.
        let candidate: string;
        
        candidate = path.join(filePathOrFolder, runFileName);
        if (fs.existsSync(candidate)) {
            return candidate;
        }
        
        candidate = path.join(filePathOrFolder, omnisharpFileName);
        if (fs.existsSync(candidate)) {
            return candidate;
        }
        
        candidate = path.join(filePathOrFolder, omnisharpExeFileName);
        if (fs.existsSync(candidate)) {
            return candidate;
        }
        
        throw new Error(`Could not fnd launch file in ${filePathOrFolder}. Expected '${runFileName}', '${omnisharpFileName}', or '${omnisharpExeFileName}'.`);
    });
}
开发者ID:bertlacy,项目名称:omnisharp-vscode,代码行数:28,代码来源:path.ts


示例2: findServerPath

    /**
     * Given a file path, returns the path to the SQL Tools service file.
     */
    public findServerPath(filePath: string, executableFiles: string[] = undefined): Promise<string> {
        return fs.lstatAsync(filePath).then(stats => {
            // If a file path was passed, assume its the launch file.
            if (stats.isFile()) {
                return filePath;
            }

            // Otherwise, search the specified folder.
            let candidate: string;

            if (executableFiles === undefined && this._config !== undefined) {
                executableFiles = this._config.getExecutableFiles();
            }
            if (executableFiles !== undefined) {
                executableFiles.forEach(element => {
                    let executableFile = path.join(filePath, element);
                    if (candidate === undefined && fs.existsSync(executableFile)) {
                        candidate = executableFile;
                        return candidate;
                    }
                });
            }


            return candidate;
        });
    }
开发者ID:AlexxNica,项目名称:sqlopsstudio,代码行数:30,代码来源:server.ts


示例3: stat_file

export async function stat_file(file_name: string): Promise<any>{
	await lock.acquire();
	let out: any; 
	try{
		out = await fs.lstatAsync(file_name);
	}
	finally{
		lock.release();
	}
	return out;
}
开发者ID:BelaPlatform,项目名称:Bela,代码行数:11,代码来源:FileManager.ts


示例4: runDotnetRestore

    return projects.map(project => {
        let projectDirectory = project.Path;

        return fs.lstatAsync(projectDirectory).then(stats => {
            if (stats.isFile()) {
                projectDirectory = path.dirname(projectDirectory);
            }

            return {
                label: `dotnet restore - (${project.Name || path.basename(project.Path)})`,
                description: projectDirectory,
                execute() {
                    return runDotnetRestore(projectDirectory);
                }
            };
        });
    });
开发者ID:bertlacy,项目名称:omnisharp-vscode,代码行数:17,代码来源:commands.ts


示例5: findServerPath

export function findServerPath(filePath: string): Promise<string> {
    return fs.lstatAsync(filePath).then(stats => {
        // If a file path was passed, assume its the launch file.
        if (stats.isFile()) {
            return filePath;
        }

        // Otherwise, search the specified folder.
        let candidate: string;
        
        candidate = path.join(filePath, 'OmniSharp.exe');
        if (fs.existsSync(candidate)) {
            return candidate;
        }
        
        candidate = path.join(filePath, 'OmniSharp');
        if (fs.existsSync(candidate)) {
            return candidate;
        }
        
        throw new Error(`Could not find OmniSharp launch file in ${filePath}.`);
    });
}
开发者ID:Firaenix,项目名称:omnisharp-vscode,代码行数:23,代码来源:omnisharp.ts



注:本文中的fs-extra-promise.lstatAsync函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript fs-extra-promise.outputFileAsync函数代码示例发布时间:2022-05-25
下一篇:
TypeScript fs-extra-promise.existsSync函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap