コード例 #1
0
ファイル: TextMode.ts プロジェクト: webreed/webreed-text-mode
  public writeFile(path: string, resource: Resource, resourceType: ResourceType): Promise<void> {
    let data: any = resource || { };

    let encoding = data["_encoding"] || resolveEncoding(resourceType);
    let body = data["body"] || "";

    return fs.writeFile(path, body, encoding);
  }
コード例 #2
0
ファイル: site.ts プロジェクト: mjwbenton/staircase-generator
 this.forEachWithFiltersTopLevel([skipMeta], (item) => {
     const itemPath = path.join(outputDir, item.filename);
     if (item.isDirectory) {
         item.children.writeToPath(itemPath);
     } else {
         fsp.writeFile(itemPath, item.content);
     }
 });
コード例 #3
0
 const resetTestModule = async () => {
   await fs.remove(testModulePath);
   await fs.mkdirs(testModulePath);
   await fs.writeFile(path.resolve(testModulePath, 'package.json'), await fs.readFile(path.resolve(__dirname, '../test/fixture/native-app1/package.json'), 'utf8'));
   await spawnPromise('npm', ['install'], {
     cwd: testModulePath,
     stdio: 'inherit',
   });
 };
コード例 #4
0
 .then(code => {
     return fsp.writeFile(outfile, code);
 })
コード例 #5
0
 generator.generateCodeFromSchema(uri).then(code => {
     return fsp.writeFile(outfile, code);
 }).then(() => {
コード例 #6
0
 public writeFile(path: string, resource: Resource, resourceType: ResourceType): Promise<void> {
   let body = (resource && resource.body) || new Buffer(0);
   return fs.writeFile(path, body);
 }