Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

zapier convert: Create .gitignore for converted app #237

Merged
merged 2 commits into from
Feb 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions scaffold/convert/gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# environment variables file
.env
.environment

# next.js build output
.next
12 changes: 11 additions & 1 deletion src/utils/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const path = require('path');
const prettier = require('prettier');
const stripComments = require('strip-comments');
const { camelCase, snakeCase } = require('./misc');
const { readFile, writeFile, ensureDir } = require('./files');
const { copyFile, readFile, writeFile, ensureDir } = require('./files');
const { printStarting, printDone } = require('./display');

const TEMPLATE_DIR = path.join(__dirname, '../../scaffold/convert');
Expand Down Expand Up @@ -1004,6 +1004,15 @@ const writeScripting = (legacyApp, newAppDir) => {
});
};

const writeGitIgnore = newAppDir => {
const srcPath = path.join(TEMPLATE_DIR, '/gitignore');
const destPath = path.join(newAppDir, '/.gitignore');
return copyFile(srcPath, destPath).then(() => {
printStarting('Writing .gitignore');
printDone();
});
};

const convertApp = (legacyApp, newAppDir) => {
const promises = [];
_.each(stepNamesMap, (cliType, wbType) => {
Expand All @@ -1019,6 +1028,7 @@ const convertApp = (legacyApp, newAppDir) => {
promises.push(writeIndex(legacyApp, newAppDir));
promises.push(writePackageJson(legacyApp, newAppDir));
promises.push(writeScripting(legacyApp, newAppDir));
promises.push(writeGitIgnore(newAppDir));

if (hasAuth(legacyApp)) {
promises.push(writeAuth(legacyApp, newAppDir));
Expand Down
3 changes: 2 additions & 1 deletion src/utils/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,6 @@ module.exports = {
readFile,
removeDir,
validateFileExists,
writeFile
writeFile,
copyFile
};