🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

bert.js

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bert.js - npm Package Compare versions

Comparing version
0.0.17
to
0.0.18
assets/bert-bg.png

Sorry, the diff of this file is not supported yet

+28
const logger = require('../../logger')
const ShellAgent = require('../Shell')
class SSHAgent {
constructor (opts = {}) {
Object.assign(this, opts)
this.shell = new ShellAgent({
logger: logger.agent,
name: this.name || 'agent'
})
}
async prepare () {
}
async ssh (args, opts = {}) {
opts.argsShow = args
return await this.shell.sh(['ssh', this.hostname, ...args], opts)
}
async sh (args, opts = {}) {
return await this.ssh(args, opts)
}
}
exports = module.exports = SSHAgent
+16
-3

@@ -8,2 +8,3 @@ 'use strict'

const DockerAgent = require('./lib/agents/Docker')
const SSHAgent = require('./lib/agents/SSH')

@@ -18,8 +19,8 @@ function Bert () {

const agent = new DockerAgent(Object.assign(opts, {name}))
const agent = new DockerAgent(Object.assign({}, opts, {name}))
agents[name] = agent
const originalSh = agent.sh
agent.sh = function (args, opts) { return originalSh.call(agent, args, opts/*, getStackTrace(2)*/) }
// const originalSh = agent.sh
// agent.sh = function (args, opts) { return originalSh.call(agent, args, opts/*, getStackTrace(2)*/) }

@@ -31,2 +32,14 @@ this.agents = agents

Bert.prototype.remote = function (name, opts = {}) {
const remotes = this.remotes || {}
const remote = new SSHAgent(Object.assign({}, opts, {name}))
remotes[name] = remote
this.remotes = remotes
return remotes[name]
}
Bert.prototype.shell = new ShellAgent()

@@ -33,0 +46,0 @@ Bert.prototype.sh = function (args, opts) { return this.shell.sh(args, opts/*, getStackTrace(1)*/) }

+1
-1

@@ -14,3 +14,3 @@ const os = require('os')

class DockerAgent {
constructor (opts) {
constructor (opts = {}) {
Object.assign(this, opts)

@@ -17,0 +17,0 @@

const ms = require('ms')
const moment = require('moment')
const chalk = require('chalk')
/* exports */
exports = module.exports = logger

@@ -15,3 +17,3 @@

getTimeTag(),
msg
chalk.reset(msg)
].join(' ')

@@ -22,5 +24,10 @@ }

logger.agent = agent
logger.task = startTask
logger.startTask = startTask
logger.stopTask = stopTask
logger.errTask = errTask
logger.task.start = startTask
logger.task.stop = stopTask
logger.task.error = errTask
logger.task.err = errTask

@@ -27,0 +34,0 @@ function shell (args) {

{
"name": "bert.js",
"version": "0.0.17",
"description": "A task manager inspired on Gulp.",
"version": "0.0.18",
"description": "A child process async.",
"main": "index.js",

@@ -21,3 +21,5 @@ "engines": {

},
"keywords": [],
"keywords": [
"child_process"
],
"author": "Jonathan Delgado <hi@jon.soy>",

@@ -24,0 +26,0 @@ "license": "MIT",

@@ -1,10 +0,12 @@

# 🍹 Bert
A task manager inspired on Gulp.
# 🍹 bert
A child process async.
![](./assets/bert-gb.png)
#f1e05a
![🍹 > bert](./assets/bert-bg.png)
## Features
- [x] Structure to cli `> bert [command]`.
- [x] Structure to cli `> bert [...tasks]`.
- [x] **DotBert**: How to read and how to work.
- [x] Run process with: `<engine>.sh`.
- [x] Run process with: `agent.sh()`.
- [x] Run this process on gulp.

@@ -11,0 +13,0 @@

Sorry, the diff of this file is not supported yet