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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rootless-config",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "description": "Store project config files outside the project root, auto-deploy them where tools expect them.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -142,10 +142,15 @@ export default {
142
142
  return
143
143
  }
144
144
 
145
- // Если stdout пайпится (Invoke-Expression) — выводим HOOK_BODY
146
- // Если терминал показываем подсказку
145
+ // Если stdout пайпится (Invoke-Expression) — выводим одну строку PS,
146
+ // которая декодирует base64 и исполняет весь блок целиком.
147
+ // Это обходит проблему PS-пайпа (строки идут по одной → незакрытые блоки).
148
+ // Правильный вызов: rootless activate | Invoke-Expression
147
149
  if (!process.stdout.isTTY) {
148
- process.stdout.write(HOOK_BODY + '\n')
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:')