@rubytech/taskmaster 1.28.1 → 1.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-info.json +3 -3
- package/dist/cli/whiteglove-cli.js +8 -1
- package/dist/logging/logger.js +16 -7
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
|
@@ -189,7 +189,14 @@ async function runInstall(packFile, opts) {
|
|
|
189
189
|
process.exit(1);
|
|
190
190
|
}
|
|
191
191
|
const { payload } = result;
|
|
192
|
-
const
|
|
192
|
+
const rawWorkspace = opts.workspace ?? path.join(os.homedir(), "taskmaster");
|
|
193
|
+
// Expand leading ~ — tilde is not shell-expanded when the workspace is passed
|
|
194
|
+
// as a CLI arg via SSH (double-quoted args suppress tilde expansion in bash).
|
|
195
|
+
const workspaceDir = rawWorkspace.startsWith("~/")
|
|
196
|
+
? path.join(os.homedir(), rawWorkspace.slice(2))
|
|
197
|
+
: rawWorkspace === "~"
|
|
198
|
+
? os.homedir()
|
|
199
|
+
: rawWorkspace;
|
|
193
200
|
console.log(theme.heading(`Installing white glove pack: ${payload.pack.name}`));
|
|
194
201
|
console.log(theme.muted(` Workspace: ${workspaceDir}`));
|
|
195
202
|
console.log("");
|
package/dist/logging/logger.js
CHANGED
|
@@ -6,9 +6,14 @@ import { Logger as TsLogger } from "tslog";
|
|
|
6
6
|
import { levelToMinLevel, normalizeLogLevel } from "./levels.js";
|
|
7
7
|
import { readLoggingConfig } from "./config.js";
|
|
8
8
|
import { loggingState } from "./state.js";
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
|
|
9
|
+
// macOS: use /tmp so the Debug UI "Open log" button points to a stable path.
|
|
10
|
+
// os.tmpdir() on macOS can be a per-user randomized path which made that button a no-op.
|
|
11
|
+
// Linux (Pi): use ~/.taskmaster/logs — /tmp uses the sticky bit so directories created
|
|
12
|
+
// there by a root process (e.g. an earlier daemon run) cannot be chmod'd by the user,
|
|
13
|
+
// making /tmp/taskmaster permanently unwritable after any accidental root creation.
|
|
14
|
+
export const DEFAULT_LOG_DIR = process.platform === "darwin"
|
|
15
|
+
? "/tmp/taskmaster"
|
|
16
|
+
: path.join(os.homedir(), ".taskmaster", "logs");
|
|
12
17
|
export const DEFAULT_LOG_FILE = path.join(DEFAULT_LOG_DIR, "taskmaster.log"); // legacy single-file path
|
|
13
18
|
const LOG_PREFIX = "taskmaster";
|
|
14
19
|
const LOG_SUFFIX = ".log";
|
|
@@ -123,15 +128,16 @@ function buildLogger(settings) {
|
|
|
123
128
|
for (const transport of externalTransports) {
|
|
124
129
|
attachExternalTransport(logger, transport);
|
|
125
130
|
}
|
|
126
|
-
return logger;
|
|
131
|
+
return { logger, resolved: settings };
|
|
127
132
|
}
|
|
128
133
|
export function getLogger() {
|
|
129
134
|
const settings = resolveSettings();
|
|
130
135
|
const cachedLogger = loggingState.cachedLogger;
|
|
131
136
|
const cachedSettings = loggingState.cachedSettings;
|
|
132
137
|
if (!cachedLogger || settingsChanged(cachedSettings, settings)) {
|
|
133
|
-
|
|
134
|
-
loggingState.
|
|
138
|
+
const { logger, resolved } = buildLogger(settings);
|
|
139
|
+
loggingState.cachedLogger = logger;
|
|
140
|
+
loggingState.cachedSettings = resolved;
|
|
135
141
|
}
|
|
136
142
|
return loggingState.cachedLogger;
|
|
137
143
|
}
|
|
@@ -162,7 +168,10 @@ export function toPinoLikeLogger(logger, level) {
|
|
|
162
168
|
};
|
|
163
169
|
}
|
|
164
170
|
export function getResolvedLoggerSettings() {
|
|
165
|
-
|
|
171
|
+
// Return cached settings when available — they reflect the actual write location,
|
|
172
|
+
// which may differ from resolveSettings() if ensureWritableLogDir fell back to a
|
|
173
|
+
// different directory (e.g. when /tmp/taskmaster is owned by root).
|
|
174
|
+
return loggingState.cachedSettings ?? resolveSettings();
|
|
166
175
|
}
|
|
167
176
|
// Test helpers
|
|
168
177
|
export function setLoggerOverride(settings) {
|