@faable/faable 1.12.0 → 1.12.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.
@@ -1,12 +1,23 @@
1
- import { cmd } from './cmd.js';
1
+ import { spawn } from 'promisify-child-process';
2
2
  import { log } from '../log.js';
3
3
 
4
4
  // Returns the "org/repo" slug of the git origin remote (the format the API
5
5
  // stores in `app.repository`), the raw URL for non-GitHub remotes, or
6
6
  // undefined when there is no usable remote.
7
+ //
8
+ // This is a best-effort auto-detection: running outside a git repository (or
9
+ // without an `origin` remote) is an expected, benign case, so failures are
10
+ // swallowed at debug level — never surfaced as errors/warnings. It does NOT
11
+ // go through `cmd()` on purpose: that helper loudly logs stderr and the exit
12
+ // code, which is right for user-invoked build steps but pure noise here.
7
13
  const getGitRemoteUrl = async (workdir) => {
8
14
  try {
9
- const { stdout } = await cmd('git remote get-url origin', { cwd: workdir });
15
+ const child = spawn('git', ['remote', 'get-url', 'origin'], {
16
+ encoding: 'utf8',
17
+ stdio: 'pipe',
18
+ cwd: workdir
19
+ });
20
+ const { stdout } = await child;
10
21
  const url = stdout?.toString().trim();
11
22
  if (!url)
12
23
  return undefined;
@@ -18,7 +29,7 @@ const getGitRemoteUrl = async (workdir) => {
18
29
  return url;
19
30
  }
20
31
  catch {
21
- log.warn('Could not detect git remote origin URL.');
32
+ log.debug('No git origin remote detected; skipping repo-based app lookup.');
22
33
  return undefined;
23
34
  }
24
35
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faable/faable",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "author": "Marc Pomar <marc@faable.com>",