Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
thanhvo-cse committed Sep 29, 2020
2 parents 94e1d4d + c7984ca commit 84f5b4a
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 44 deletions.
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $ npm install -g @thanhvo-cse/dev-env
$ dev-env COMMAND
running command...
$ dev-env (-v|--version|version)
@thanhvo-cse/dev-env/0.6.0 darwin-x64 node-v12.14.0
@thanhvo-cse/dev-env/0.7.0 darwin-x64 node-v12.14.0
$ dev-env --help [COMMAND]
USAGE
$ dev-env COMMAND
Expand Down Expand Up @@ -76,7 +76,7 @@ Test it out, e.g.
* [`dev-env ls`](#dev-env-ls)
* [`dev-env magento`](#dev-env-magento)
* [`dev-env magerun`](#dev-env-magerun)
* [`dev-env mysql PROJECT COMMAND [FILE]`](#dev-env-mysql-project-command-file)
* [`dev-env mysql COMMAND [FILE]`](#dev-env-mysql-command-file)
* [`dev-env npm`](#dev-env-npm)
* [`dev-env php`](#dev-env-php)
* [`dev-env rebuild`](#dev-env-rebuild)
Expand All @@ -101,7 +101,7 @@ OPTIONS
-s, --source with source
```

_See code: [src/commands/artisan.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/artisan.ts)_
_See code: [src/commands/artisan.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/artisan.ts)_

## `dev-env autocomplete [SHELL]`

Expand Down Expand Up @@ -138,7 +138,7 @@ OPTIONS
-h, --help show CLI help
```

_See code: [src/commands/cleanup.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/cleanup.ts)_
_See code: [src/commands/cleanup.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/cleanup.ts)_

## `dev-env composer`

Expand All @@ -154,7 +154,7 @@ OPTIONS
-s, --source with source
```

_See code: [src/commands/composer.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/composer.ts)_
_See code: [src/commands/composer.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/composer.ts)_

## `dev-env configure:docker-source [PATH]`

Expand All @@ -171,7 +171,7 @@ OPTIONS
-h, --help show CLI help
```

_See code: [src/commands/configure/docker-source.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/configure/docker-source.ts)_
_See code: [src/commands/configure/docker-source.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/configure/docker-source.ts)_

## `dev-env configure:gdrive [KEY]`

Expand All @@ -188,7 +188,7 @@ OPTIONS
-h, --help show CLI help
```

_See code: [src/commands/configure/gdrive.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/configure/gdrive.ts)_
_See code: [src/commands/configure/gdrive.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/configure/gdrive.ts)_

## `dev-env configure:workspace [PATH]`

Expand All @@ -205,7 +205,7 @@ OPTIONS
-h, --help show CLI help
```

_See code: [src/commands/configure/workspace.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/configure/workspace.ts)_
_See code: [src/commands/configure/workspace.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/configure/workspace.ts)_

## `dev-env configure:xdebug-ide-key [KEY]`

Expand All @@ -222,7 +222,7 @@ OPTIONS
-h, --help show CLI help
```

_See code: [src/commands/configure/xdebug-ide-key.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/configure/xdebug-ide-key.ts)_
_See code: [src/commands/configure/xdebug-ide-key.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/configure/xdebug-ide-key.ts)_

## `dev-env create PROJECT TEMPLATE`

Expand All @@ -242,7 +242,7 @@ OPTIONS
-l, --local locally
```

_See code: [src/commands/create.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/create.ts)_
_See code: [src/commands/create.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/create.ts)_

## `dev-env down PROJECT`

Expand All @@ -261,7 +261,7 @@ OPTIONS
-s, --source with source
```

_See code: [src/commands/down.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/down.ts)_
_See code: [src/commands/down.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/down.ts)_

## `dev-env export PROJECT`

Expand All @@ -279,7 +279,7 @@ OPTIONS
-h, --help show CLI help
```

_See code: [src/commands/export.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/export.ts)_
_See code: [src/commands/export.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/export.ts)_

## `dev-env grunt`

Expand All @@ -295,7 +295,7 @@ OPTIONS
-s, --source with source
```

_See code: [src/commands/grunt.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/grunt.ts)_
_See code: [src/commands/grunt.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/grunt.ts)_

## `dev-env help [COMMAND]`

Expand Down Expand Up @@ -329,7 +329,7 @@ OPTIONS
-h, --help show CLI help
```

_See code: [src/commands/import.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/import.ts)_
_See code: [src/commands/import.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/import.ts)_

## `dev-env ls`

Expand All @@ -345,7 +345,7 @@ OPTIONS
-s, --source with source
```

_See code: [src/commands/ls.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/ls.ts)_
_See code: [src/commands/ls.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/ls.ts)_

## `dev-env magento`

Expand All @@ -362,7 +362,7 @@ OPTIONS
-s, --source with source
```

_See code: [src/commands/magento.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/magento.ts)_
_See code: [src/commands/magento.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/magento.ts)_

## `dev-env magerun`

Expand All @@ -379,18 +379,17 @@ OPTIONS
-s, --source with source
```

_See code: [src/commands/magerun.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/magerun.ts)_
_See code: [src/commands/magerun.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/magerun.ts)_

## `dev-env mysql PROJECT COMMAND [FILE]`
## `dev-env mysql COMMAND [FILE]`

Mysql

```
USAGE
$ dev-env mysql PROJECT COMMAND [FILE]
$ dev-env mysql COMMAND [FILE]
ARGUMENTS
PROJECT project name
COMMAND (backup|restore) mysql commands
FILE file path
Expand All @@ -400,7 +399,7 @@ OPTIONS
-s, --source with source
```

_See code: [src/commands/mysql.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/mysql.ts)_
_See code: [src/commands/mysql.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/mysql.ts)_

## `dev-env npm`

Expand All @@ -416,7 +415,7 @@ OPTIONS
-s, --source with source
```

_See code: [src/commands/npm.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/npm.ts)_
_See code: [src/commands/npm.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/npm.ts)_

## `dev-env php`

Expand All @@ -433,7 +432,7 @@ OPTIONS
-s, --source with source
```

_See code: [src/commands/php.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/php.ts)_
_See code: [src/commands/php.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/php.ts)_

## `dev-env rebuild`

Expand All @@ -449,7 +448,7 @@ OPTIONS
-s, --source with source
```

_See code: [src/commands/rebuild.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/rebuild.ts)_
_See code: [src/commands/rebuild.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/rebuild.ts)_

## `dev-env remove PROJECT`

Expand All @@ -467,7 +466,7 @@ OPTIONS
-l, --local locally
```

_See code: [src/commands/remove.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/remove.ts)_
_See code: [src/commands/remove.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/remove.ts)_

## `dev-env restart`

Expand All @@ -483,7 +482,7 @@ OPTIONS
-s, --source with source
```

_See code: [src/commands/restart.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/restart.ts)_
_See code: [src/commands/restart.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/restart.ts)_

## `dev-env shell PROJECT`

Expand All @@ -500,7 +499,7 @@ OPTIONS
-h, --help show CLI help
```

_See code: [src/commands/shell.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/shell.ts)_
_See code: [src/commands/shell.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/shell.ts)_

## `dev-env sync`

Expand All @@ -516,7 +515,7 @@ OPTIONS
-s, --source with source
```

_See code: [src/commands/sync.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/sync.ts)_
_See code: [src/commands/sync.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/sync.ts)_

## `dev-env up PROJECT`

Expand All @@ -532,8 +531,9 @@ ARGUMENTS
OPTIONS
-h, --help show CLI help
-l, --local locally
-o, --open Open project local domain on default local browser
-s, --source with source
```

_See code: [src/commands/up.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.6.0/src/commands/up.ts)_
_See code: [src/commands/up.ts](https://github.com/thanhvo-cse/dev-env/blob/v0.7.0/src/commands/up.ts)_
<!-- commandsstop -->
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@thanhvo-cse/dev-env",
"description": "Development environment management tool",
"version": "0.6.0",
"version": "0.7.0",
"author": "Thanh Vo - thanhvo.cse@gmail.com",
"bin": {
"dev-env": "./bin/run"
Expand Down
2 changes: 1 addition & 1 deletion src/commands/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default class Export extends Command {

await this.fileTransport.initUpstreamDir(project)

await docker.push(project)
//await docker.push(project)

await this.fileTransport.copySourceToUpstream('system')
await this.fileTransport.copySourceToUpstream(project)
Expand Down
13 changes: 3 additions & 10 deletions src/commands/mysql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ export default class Mysql extends Command {
static description = 'Mysql'

static args = [
{
name: Const.ARG_PROJECT,
required: true,
description: 'project name',
hidden: false
},
{
name: 'command',
required: true,
Expand Down Expand Up @@ -46,18 +40,17 @@ export default class Mysql extends Command {
}

async run() {
const project = this.args[Const.ARG_PROJECT]
const docker = await this.getDocker()

const dbBackupFile = await docker.getDbBackupFile(project)
const dbBackupFile = await docker.getDbBackupFile(this.project)
const dbBackupFileBk = normalize(dbBackupFile) + '.bk'

if (this.args.file != undefined && fs.existsSync(dbBackupFile)) {
await fs.moveSync(dbBackupFile, dbBackupFileBk, {overwrite: true})
}

if (this.args.command == 'backup') {
await docker.dbBackup(project)
await docker.dbBackup(this.project)

if (this.args.file != undefined) {
await fs.copySync(dbBackupFile, this.args.file, {overwrite: true})
Expand All @@ -67,7 +60,7 @@ export default class Mysql extends Command {
await fs.copySync(this.args.file, dbBackupFile, {overwrite: true})
}

await docker.dbRestore(project)
await docker.dbRestore(this.project)
}

if (this.args.file != undefined && fs.existsSync(dbBackupFileBk)) {
Expand Down
3 changes: 1 addition & 2 deletions src/commands/up.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ export default class Up extends Command {

const projectDir = await this.getProjectDir(project)
const projectDomain = `https://local-${project}.legato.co`
await this.shell.script(`cd ${projectDir} && docker-sync start`)
//await this.shell.script(`cd ${projectDir} && docker-sync start`)

await docker.up(project)
console.log('')
console.log(`Project started on ${projectDomain}`)
this.shell.script(`open ${projectDomain}`)
}
Expand Down

0 comments on commit 84f5b4a

Please sign in to comment.