本文整理汇总了TypeScript中fs-extra.symlinkSync函数的典型用法代码示例。如果您正苦于以下问题:TypeScript symlinkSync函数的具体用法?TypeScript symlinkSync怎么用?TypeScript symlinkSync使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了symlinkSync函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: expect
const preparations = () => {
fse.outputFileSync("have_to_stay_file", "abc");
fse.mkdirsSync("to_remove");
fse.symlinkSync("../have_to_stay_file", "to_remove/symlink");
// Make sure we symlinked it properly.
expect(fse.readFileSync("to_remove/symlink", "utf8")).to.equal("abc");
};
示例2: linkDependency
function linkDependency(pkgDir: string, dependencyName: string, dependencyDir: string) {
let dest = path.join(pkgDir, 'node_modules', dependencyName);
// use fs-extra
mkdirp.sync(path.dirname(dest));
rimraf.sync(dest);
fs.symlinkSync(dependencyDir, dest);
}
示例3: beforeEach
beforeEach((done) => {
// Increase timeout for these tests only.
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
spyOn(console, 'error');
// symlink custom collections to node_modules, so we can use with ng new
// it is a bit dirty, but bootstrap-local tricks won't work here
fs.symlinkSync(`${process.cwd()}/tests/collections/@custom`, `./node_modules/@custom`, 'dir');
tmp.setup('./tmp')
.then(() => process.chdir('./tmp'))
.then(() => done());
}, 10000);
示例4:
const preparations = () => {
fse.outputFileSync("dir/file.txt", "abc");
fse.symlinkSync("dir/file.txt", "symlinked_file.txt");
};
示例5:
const preparations = () => {
fse.mkdirsSync("to_copy");
fse.symlinkSync("some/file", "to_copy/symlink");
fse.mkdirsSync("copied");
fse.symlinkSync("some/other_file", "copied/symlink");
};