Skip to content

Commit

Permalink
Adding version git repo info under the banner.
Browse files Browse the repository at this point in the history
Fixing an issue when STM home is set explicityly via environment variable.
  • Loading branch information
gvensan committed Jul 22, 2024
1 parent 335ff35 commit 969674f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 2 additions & 0 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const { Commander } = require('..')
const chalk = require('chalk')
const process = require('node:process');
const { version, repository } = require('../package.json');
process.noDeprecation = true

const {emitWarning} = process;
Expand Down Expand Up @@ -63,6 +64,7 @@ try {
console.log(chalk.hex('#00c895').bold("╚══██║██║ ██║██║ ██╔═██║██║ ██╔╝ ██║ ██╔═██╗ ╚██╔╝ ███ ██║╚██╝██║██╔╝ "))
console.log(chalk.hex('#00c895').bold("█████║╚█████╔╝█████╗██║ ██║╚████╗████╗ ██║ ██║ ██║ ██║ ██║ ╚╝ ██║█████╗"))
console.log(chalk.hex('#00c895').bold("╚════╝ ╚════╝ ╚════╝╚═╝ ╚═╝ ╚═══╝╚═══╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚════╝"))
console.log(`v${version} - ${repository.url}`)
console.log("")

commander.init();
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"name": "stm",
"version": "0.0.42",
"description": "Solace Try-Me Command Line Tool",
"repository": {
"type": "git",
"url": "https://github.com/SolaceLabs/solace-tryme-cli"
},
"keywords": [
"solace",
"tryme",
Expand Down
2 changes: 1 addition & 1 deletion public/feedportal
Submodule feedportal updated 1 files
+2 −2 README.md
11 changes: 3 additions & 8 deletions src/common/publish-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { STM_CLIENT_CONNECTED, STM_CLIENT_DISCONNECTED, STM_EVENT_PUBLISHED } fr
import { getDefaultClientName, getType } from "../utils/defaults";
import { VisualizeClient } from "./visualize-client";
import { randomUUID } from "crypto";
import { create } from 'domain';
const { uuid } = require('uuidv4');

const logLevelMap:Map<string, LogLevel> = new Map<string, LogLevel>([
Expand Down Expand Up @@ -195,14 +194,10 @@ export class SolaceClient extends VisualizeClient {
}
}
else {
if (payloadType === 'text')
message.setSdtContainer(solace.SDTField.create(solace.SDTFieldType.STRING, ""));
else {
if (payloadType === 'text') {
message.setSdtContainer(solace.SDTField.create(solace.SDTFieldType.STRING, ""));
// message.setBinaryAttachment("");
// const encoder = new TextEncoder();
// const result = encoder.encode("");
// message.setBinaryAttachment(Buffer.from([0x00, 0x00, 0x00, 0x00, 0x00]));
} else {
message.setBinaryAttachment("");
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/utils/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const defaultMessageConfig:any = {
// userCos: NOT CONSIDERED
// userData: NOT CONSIDERED
userPropertyMap: undefined,
payloadType: "text",
payloadType: "TEXT",
outputMode: 'DEFAULT',
pretty: false
}
Expand Down Expand Up @@ -408,7 +408,7 @@ export const getType = (message:solace.Message) => {
}

var currentHomeDir = require('os').homedir();
var currentStmHome = currentHomeDir;
var currentStmHome = `${currentHomeDir}/.stm`;

if (process.env.STM_HOME) {
currentStmHome = process.env.STM_HOME;
Expand Down

0 comments on commit 969674f

Please sign in to comment.