rootless-config 1.7.3 → 1.7.4
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/package.json
CHANGED
|
@@ -142,10 +142,15 @@ export default {
|
|
|
142
142
|
return
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
// Если stdout пайпится (Invoke-Expression) — выводим
|
|
146
|
-
//
|
|
145
|
+
// Если stdout пайпится (Invoke-Expression) — выводим одну строку PS,
|
|
146
|
+
// которая декодирует base64 и исполняет весь блок целиком.
|
|
147
|
+
// Это обходит проблему PS-пайпа (строки идут по одной → незакрытые блоки).
|
|
148
|
+
// Правильный вызов: rootless activate | Invoke-Expression
|
|
147
149
|
if (!process.stdout.isTTY) {
|
|
148
|
-
|
|
150
|
+
const encoded = Buffer.from(HOOK_BODY, 'utf8').toString('base64')
|
|
151
|
+
process.stdout.write(
|
|
152
|
+
`[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('${encoded}')) | Invoke-Expression\n`
|
|
153
|
+
)
|
|
149
154
|
} else {
|
|
150
155
|
logger.info('')
|
|
151
156
|
logger.info('To activate the CURRENT session, run:')
|