Skip to content

Made the init method trigger also the install #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ tpt -c --templates teleport-webpack-react,teleport-express-webrouter, teleport-f

By default Teleport generates a random app name for you (like `app-685af6ba`). To specify your own app name, use `--name my-app-name`.

Also, you could have already created a project folder, and in that case you could have just to type inside the folder for doing the same thing:
```
tpt -i --templates teleport-webpack-react,teleport-express-webrouter, teleport-flask-websocket,teleport-heroku
```

You can have more informations about those templates by checking their repos:
- [Webpack React](https://github.com/snipsco/teleport-webpack-react)
- [Express webrouter](https://github.com/snipsco/teleport-express-webrouter)
Expand Down
16 changes: 8 additions & 8 deletions docs/teleport_methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ We defined a set of methods splitting this workflow into small pieces of tasks (
| | | - merge the config files from templates
| | +-- dump
| | | - merge the file systems from templates
| +-- install
| | - install python and or node dependencies in each server
| | - install node dependencies for frontend (if it exists)
| | +-- replace
| | | - grab all the placeholder files in the templates and write them into the project with replaced config values
| | | +-- connect (docker case)
| | | | - if no port was specified, Teleport finds the ones that are available
| | | | for your deployed servers.
| | +-- install
| | | - install python and or node dependencies in each server
| | | - install node dependencies for frontend (if it exists)
| | | +-- replace
| | | - grab all the placeholder files in the templates and write them into the project with replaced config values
| | | | +-- connect (docker case)
| | | | - if no port was specified, Teleport finds the ones that are available
| | | | for your deployed servers.
+-- start
| - start locally the manager for each server
| - start frontend dev server (if it exists)
Expand Down
3 changes: 2 additions & 1 deletion src/methods/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import { getGitignores,

export function configure () {
const { project } = this
// log
this.consoleInfo('Let\'s configure the project')
// script
if (fs.existsSync(path.join(this.project.dir, 'bin/configure.sh'))) {
this.configureScript()
Expand All @@ -36,7 +38,6 @@ export function configure () {

export function configureScript () {
const command = `cd ${this.project.dir} && sh bin/configure.sh`
this.consoleInfo('Let\'s configure the project')
this.consoleLog(command)
childProcess.execSync(command, { stdio: [0, 1, 2] })
}
Expand Down
2 changes: 1 addition & 1 deletion src/methods/dump.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function dumpMergeFrontendServer () {
const buffer = childProcess.execSync(command)
console.log(buffer.toString('utf-8'))
}
if (program.create) {
if (program.create || program.init) {
this.install()
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/methods/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import path from 'path'
import { writeGitignore, writePackage } from '../utils/functions'

export function init () {
// unpack
const { app, program, project } = this
// log
this.consoleInfo('Let\'s init the project')
// name
const name = program.name || project.dir.split('/').slice(-1)[0]
// dirs
Expand Down
2 changes: 2 additions & 0 deletions src/methods/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ import fs from 'fs'
import path from 'path'

export function install () {
// unpack
const { backend, program, project } = this
if (!backend) return
// log
this.consoleInfo(`Let\'s install this project !`)
// NOTE: this.concurrentlyInstallCommands is populated by the following commands
this.installScript()
Expand Down
4 changes: 2 additions & 2 deletions src/utils/program.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export default program
.option('-c, create', 'Create')
.option('-d, deploy', 'Deploy')
.option('dump', 'Dump')
.option('init', 'Init')
.option('-i, install', 'Install')
.option('-i, init', 'Init')
.option('install', 'Install')
.option('-p, push', 'Push')
.option('replace', 'Replace')
.option('-r, run', 'Run')
Expand Down