How to use the shelljs.touch function in shelljs

To help you get started, we’ve selected a few shelljs 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 shelljs / shx / test / specs / cli.js View on Github external
beforeEach(() => {
      // create test files
      shell.touch(testFileName1);
      shell.ShellString(testContents1).to(testFileName1);

      shell.mkdir('-p', path.dirname(testFileName2));
      shell.touch(testFileName2);
      shell.ShellString(testContents2).to(testFileName2);

      shell.touch(testFileName3);
      shell.ShellString(testContents3).to(testFileName3);

      shell.touch(testFileName4);
      shell.ShellString(testContents4).to(testFileName4);
    });
github ahmadawais / create-guten-block / packages / create-guten-block / app / npmInstallScripts.js View on Github external
module.exports = ( blockName, blockDir, isCanary ) => {
	shell.cd( blockDir );
	shell.touch( 'package.json' );

	// Build a package.json file since npm install needs it.
	const appPackage = {
		name: `${ blockName }-cgb-guten-block`,
		version: '1.0.0',
		private: true,
		scripts: {
			start: 'cgb-scripts start',
			build: 'cgb-scripts build',
			eject: 'cgb-scripts eject',
		},
	};

	// Write the package.json file.
	fs.writeFileSync( path.join( process.cwd(), 'package.json' ), JSON.stringify( appPackage, null, 2 ) + '\n' );
github dthree / cash / test / mv.js View on Github external
function reset() {
  burninate();
  $.mkdir('mvtemp');
  $.touch('mv-a');
  $.touch('mv-b');
  $.touch('mv-c');
}
github Tubitv / envoy-node / tools / gh-pages-publish.ts View on Github external
if (typeof pkg.repository === "object") {
  if (!pkg.repository.hasOwnProperty("url")) {
    throw new Error("URL does not exist in repository section");
  }
  repoUrl = pkg.repository.url;
} else {
  repoUrl = pkg.repository;
}

let parsedUrl = url.parse(repoUrl);
let repository = (parsedUrl.host || "") + (parsedUrl.path || "");
let ghToken = process.env.GH_TOKEN;

echo("Deploying docs!!!");
cd("dist/docs");
touch(".nojekyll");
exec("git init");
exec("git add .");
exec('git config user.name "Yingyu Cheng"');
exec('git config user.email "github@winguse.com"');
exec('git commit -m "docs(docs): update gh-pages"');
exec(
  `git push --force --quiet "https://${ghToken}@${repository}" master:gh-pages`
);
echo("Docs deployed!!");
github transmute-industries / transmute / packages / transmute-framework / tools / gh-pages-publish.ts View on Github external
if (typeof pkg.repository === "object") {
  if (!pkg.repository.hasOwnProperty("url")) {
    throw new Error("URL does not exist in repository section")
  }
  repoUrl = pkg.repository.url
} else {
  repoUrl = pkg.repository
}

let parsedUrl = url.parse(repoUrl)
let repository = (parsedUrl.host || "") + (parsedUrl.path || "")
let ghToken = process.env.GH_TOKEN

echo("Deploying docs!!!")
cd("dist/docs")
touch(".nojekyll")
exec("git init")
exec("git add .")
exec('git config user.name "Orie Steele"')
exec('git config user.email "orie@ohs.io"')
exec('git commit -m "docs(docs): update gh-pages"')
exec(
  `git push --force --quiet "https://${ghToken}@${repository}" master:gh-pages`
)
echo("Docs deployed!!")
github shiftcode / dynamo-easy / tools / gh-pages-publish.ts View on Github external
if (typeof pkg.repository === 'object') {
    if (!pkg.repository.hasOwnProperty('url')) {
      throw new Error('URL does not exist in repository section')
    }
    repoUrl = pkg.repository.url
  } else {
    repoUrl = pkg.repository
  }

  const parsedUrl = url.parse(repoUrl)
  const repository = (parsedUrl.host || '') + (parsedUrl.path || '')
  const ghToken = process.env.GH_TOKEN

  echo('Deploying docs!!!')
  cd('dist/docs')
  touch('.nojekyll')
  exec('git init')
  exec('git add .')
  exec('git config user.name "Michael Wittwer"')
  exec('git config user.email "michael.wittwer@shiftcode.ch"')
  exec('git commit -m "docs(docs): update gh-pages"')
  exec(
    `git push --force --quiet "https://${ghToken}@${repository}" master:gh-pages`
  )
  echo('Docs deployed!!')
} else {
  echo('Not running on master -> skipping docs deployment')
}
github simplyspoke / node-harvest / tools / gh-pages-publish.ts View on Github external
if (typeof pkg.repository === "object") {
  if (!pkg.repository.hasOwnProperty("url")) {
    throw new Error("URL does not exist in repository section")
  }
  repoUrl = pkg.repository.url
} else {
  repoUrl = pkg.repository
}

let parsedUrl = url.parse(repoUrl)
let repository = (parsedUrl.host || "") + (parsedUrl.path || "")
let ghToken = process.env.GH_TOKEN

echo("Deploying docs!!!")
cd("docs")
touch(".nojekyll")
exec("git init")
exec("git add .")
exec('git config user.name "Tristan Fitzgerald"')
exec('git config user.email "tristan@simplyspoke.com"')
exec('git commit -m "docs(docs): update gh-pages"')
exec(
  `git push --force --quiet "https://${ghToken}@${repository}" master:gh-pages`
)
echo("Docs deployed!!")
github liuSyen / ys-tool / tools / gh-pages-publish.ts View on Github external
if (typeof pkg.repository === "object") {
  if (!pkg.repository.hasOwnProperty("url")) {
    throw new Error("URL does not exist in repository section")
  }
  repoUrl = pkg.repository.url
} else {
  repoUrl = pkg.repository
}

let parsedUrl = url.parse(repoUrl)
let repository = (parsedUrl.host || "") + (parsedUrl.path || "")
let ghToken = process.env.GH_TOKEN

echo("Deploying docs!!!")
cd("docs")
touch(".nojekyll")
exec("git init")
exec("git add .")
exec('git config user.name "sanye"')
exec('git config user.email "liubingjian@hzyushi.cn"')
exec('git commit -m "docs(docs): update gh-pages"')
exec(
  `git push --force --quiet "https://github.com/liuSyen/ys-tool.git" master:gh-pages`
)
echo("Docs deployed!!")
github gramps-graphql / gramps-express / bin / gramps.js View on Github external
globby.sync(fileGlob).forEach(file => {
    const fileName = path.basename(file);
    const tmpFile = path.join(targetDir, fileName);
    const transpiled = babel.transformFileSync(file);

    shell.touch(tmpFile);
    shell.ShellString(transpiled.code).to(tmpFile);
    shell.echo(chalk.dim(` -> transpiled ${fileName}`));
  });
}
github third774 / image-focus / tools / gh-pages-publish.ts View on Github external
if (typeof pkg.repository === "object") {
  if (!pkg.repository.hasOwnProperty("url")) {
    throw new Error("URL does not exist in repository section")
  }
  repoUrl = pkg.repository.url
} else {
  repoUrl = pkg.repository
}

let parsedUrl = url.parse(repoUrl)
let repository = (parsedUrl.host || "") + (parsedUrl.path || "")
let ghToken = process.env.GH_TOKEN

echo("Deploying docs!!!")
cd("dist/docs")
touch(".nojekyll")
exec("git init")
exec("git add .")
exec('git config user.name "Kevin Kipp"')
exec('git config user.email "kevin.kipp@gmail.com"')
exec('git commit -m "docs(docs): update gh-pages"')
exec(`git push --force --quiet "https://${ghToken}@${repository}" master:gh-pages`)
echo("Docs deployed!!")