本文整理匯總了TypeScript中vinyl-fs.symlink函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript symlink函數的具體用法?TypeScript symlink怎麽用?TypeScript symlink使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了symlink函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should report IO errors', done => {
const inputPath = path.join(__dirname, './fixtures/test.coffee');
const inputBase = path.join(__dirname, './fixtures/');
const expectedPath = path.join(__dirname, './out-fixtures/test.coffee');
const expectedContents = fs.readFileSync(inputPath);
const expectedCwd = __dirname;
const expectedBase = path.join(__dirname, './out-fixtures');
const expectedMode = parseInt("0722", 8);
const expectedFile = new File({
base: inputBase,
cwd: __dirname,
path: inputPath,
contents: expectedContents,
stat: {
mode: expectedMode
} as fs.Stats
});
fs.mkdirSync(expectedBase);
fs.chmodSync(expectedBase, 0);
const stream = vfs.symlink('./out-fixtures/', { cwd: __dirname });
stream.on('error', (err: any) => {
err.code.should.equal('EACCES');
done();
});
stream.write(expectedFile);
});
示例2:
export = () => {
return vfs.src( 'node_modules' )
.pipe( vfs.symlink( Config.DEV_DEST ) );
};