How to use the hexo-fs.unlink function in hexo-fs

To help you get started, we’ve selected a few hexo-fs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hexojs / hexo / lib / hexo / post.js View on Github external
}).then(() => // Remove the original draft file
    fs.unlink(src)).then(() => {
    if (!config.post_asset_folder) return;
github hexojs / hexo / test / scripts / console / config.js View on Github external
  it('create config if not exist', () => fs.unlink(hexo.config_path).then(() => writeConfig('subtitle', 'Hello world')).then(config => {
    config.subtitle.should.eql('Hello world');
  }));
});
github hexojs / hexo-renderer-ejs / test / index.js View on Github external
}).finally(() => {
      return fs.unlink(includePath);
    });
  });
github hexojs / hexo / test / scripts / console / config.js View on Github external
return fs.writeFile(configPath, '{}').then(() => config({_: ['title', 'My Blog']})).then(() => fs.readFile(configPath)).then(content => {
      const json = JSON.parse(content);

      json.title.should.eql('My Blog');

      hexo.config_path = pathFn.join(hexo.base_dir, '_config.yml');
      return fs.unlink(configPath);
    });
  });
github hexojs / hexo / test / scripts / console / render.js View on Github external
return fs.writeFile(src, body).then(() => render({_: ['test.yml'], output: dest})).then(() => fs.readFile(dest)).then(result => {
      JSON.parse(result).should.eql({
        foo: 1,
        bar: {
          boo: 2
        }
      });

      return Promise.all([
        fs.unlink(src),
        fs.unlink(dest)
      ]);
    });
  });
github hexojs / hexo / test / scripts / hexo / update_package.js View on Github external
return fs.writeFile(packagePath, JSON.stringify(pkg)).then(() => updatePkg(hexo)).then(() => fs.readFile(packagePath)).then(content => {
      JSON.parse(content).hexo.version.should.eql(hexo.version);
      hexo.env.init.should.be.true;

      return fs.unlink(packagePath);
    });
  });
github hexojs / hexo / test / scripts / filters / new_post_path.js View on Github external
}, true)).then(target => {
      target.should.eql(path);
      return fs.unlink(path);
    });
  });
github hexojs / hexo-cli / lib / console / init.js View on Github external
function removeGitModules(target) {
  return fs.unlink(pathFn.join(target, '.gitmodules')).catch(err => {
    if (err.cause && err.cause.code === 'ENOENT') return;
    throw err;
  });
}