Skip to content

Commit

Permalink
Merge pull request #104 from JarvusInnovations/develop
Browse files Browse the repository at this point in the history
Release: hologit v0.34.1
  • Loading branch information
themightychris authored Dec 20, 2020
2 parents 21a1f72 + 1efc382 commit 85e62c0
Show file tree
Hide file tree
Showing 14 changed files with 508 additions and 32 deletions.
28 changes: 16 additions & 12 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@

// setup logger
const logger = require('winston');
module.exports = { logger };

if (process.env.DEBUG) {
logger.level = 'debug';
}
const loggerConsole = new logger.transports.Console({
level: process.env.DEBUG ? 'debug' : 'info',
format: logger.format.combine(
logger.format.colorize(),
logger.format.prettyPrint(),
logger.format.splat(),
logger.format.simple(),
),

// all logger output to STDERR
stderrLevels: Object.keys(require('winston/lib/winston/config').cli.levels)
});
logger.add(loggerConsole);


// all logger output to STDERR
for (const level in logger.levels) {
logger.default.transports.console.stderrLevels[level] = true;
}
module.exports = { logger };


// route command line
Expand All @@ -33,9 +37,9 @@ require('yargs')
})
.check(function (argv) {
if (argv.debug) {
logger.level = 'debug';
loggerConsole.level = 'debug';
} else if (argv.quiet) {
logger.level = 'error';
loggerConsole.level = 'error';
}

return true;
Expand Down
8 changes: 4 additions & 4 deletions commands/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ exports.handler = async function init ({ name = null } = {}) {

// get repo interface
const repo = await Repo.getFromEnvironment({ working: true });
logger.debug('instantiated repository:', repo);
logger.debug('instantiated repository: %o', repo);


// compute repo name
if (!name) {
if (repo.workTree) {
logger.debug('computing name from work tree:', repo.workTree);
logger.debug('computing name from work tree: %o', repo.workTree);
name = path.basename(repo.workTree);
} else {
logger.debug('computing name from git dir:', repo.gitDir);
logger.debug('computing name from git dir: %o', repo.gitDir);
const nameStack = repo.gitDir.split(path.sep);
name = nameStack.pop();

Expand All @@ -41,7 +41,7 @@ exports.handler = async function init ({ name = null } = {}) {
// read workspace config
const workspace = await repo.getWorkspace();
let repoConfig = await workspace.readConfig();
logger.debug('loaded existing holorepo config:', repoConfig);
logger.debug('loaded existing holorepo config: %o', repoConfig);


// initialize repo config
Expand Down
2 changes: 1 addition & 1 deletion commands/source/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ exports.handler = async function createSource ({

// generate source name if not specified
if (!name) {
logger.debug('computing name from url:', url);
logger.debug(`computing name from url: ${url}`);
const nameStack = url.split(path.sep);
name = nameStack.pop();

Expand Down
2 changes: 1 addition & 1 deletion commands/studio.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ exports.handler = async function watch ({ socket }) {
});
}).listen(socket);

logger.info('listening on', socket);
logger.info('listening on %o', socket);
};
1 change: 1 addition & 0 deletions github-actions/projector/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ outputs:
runs:
using: 'node12'
main: 'index.js'
post: 'post.js'
Loading

0 comments on commit 85e62c0

Please sign in to comment.