npx https://gist.github.com/74c68c24a440c7cfbd78ccce5e9652d4 test-app
Last active
August 26, 2019 03:05
-
-
Save TAKEDA-Takashi/74c68c24a440c7cfbd78ccce5e9652d4 to your computer and use it in GitHub Desktop.
create clasp app project.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const fs = require('fs'); | |
const { spawnSync } = require('child_process'); | |
const [,, ...args] = process.argv; | |
const project_dir = args[0]; | |
try { | |
fs.mkdirSync(project_dir); | |
process.chdir(project_dir); | |
spawnSync('git', ['init'], { stdio: 'inherit' }); | |
fs.writeFileSync('README.md', `# ${project_dir}`); | |
fs.writeFileSync('.gitignore', 'node_modules/'); | |
spawnSync('npm', ['init', '-y'], { stdio: 'inherit' }); | |
spawnSync('npm', ['install', '-D', '@google/clasp'], { stdio: 'inherit' }); | |
spawnSync('npm', ['install', '-D', '@types/google-apps-script'], { stdio: 'inherit' }); | |
spawnSync('git', ['add', '.'], { stdio: 'inherit' }); | |
spawnSync('git', ['commit', '-m', 'initial commit'], { stdio: 'inherit' }); | |
} catch (err) { | |
console.log(err); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"name": "create-clasp-app", "version": "0.0.0", "bin": "./index.js"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment