本文整理匯總了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");
};