當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript fs-extra.symlinkSync函數代碼示例

本文整理匯總了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");
 };
開發者ID:szwacz,項目名稱:fs-jetpack,代碼行數:7,代碼來源:remove.spec.ts

示例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);
}
開發者ID:acburdine,項目名稱:denali,代碼行數:7,代碼來源:server-test.ts

示例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);
開發者ID:3L4CKD4RK,項目名稱:angular-cli,代碼行數:14,代碼來源:new.spec.ts

示例4:

 const preparations = () => {
   fse.outputFileSync("dir/file.txt", "abc");
   fse.symlinkSync("dir/file.txt", "symlinked_file.txt");
 };
開發者ID:szwacz,項目名稱:fs-jetpack,代碼行數:4,代碼來源:inspect.spec.ts

示例5:

 const preparations = () => {
   fse.mkdirsSync("to_copy");
   fse.symlinkSync("some/file", "to_copy/symlink");
   fse.mkdirsSync("copied");
   fse.symlinkSync("some/other_file", "copied/symlink");
 };
開發者ID:szwacz,項目名稱:fs-jetpack,代碼行數:6,代碼來源:copy.spec.ts


注:本文中的fs-extra.symlinkSync函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。