Skip to content

Commit

Permalink
fix(interactive-processes): stop spinner (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pmejna authored Dec 5, 2024
1 parent 3b234ff commit a357704
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changeset/dry-stingrays-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'stplr-core': patch
'stplr': patch
---

Fix interactive auth processes hanging
1 change: 1 addition & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"cuddly-shrimps-cheat",
"curly-ligers-cheat",
"curly-pants-fry",
"dry-stingrays-rhyme",
"famous-donkeys-compete",
"fast-nails-smoke",
"few-panthers-hammer",
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# stplr

## 0.1.0-alpha.40

### Patch Changes

- Fix interactive auth processes hanging

## 0.1.0-alpha.39

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stplr",
"version": "0.1.0-alpha.39",
"version": "0.1.0-alpha.40",
"main": "./dist/index.mjs",
"bin": {
"stplr": "./dist/index.mjs"
Expand Down
6 changes: 6 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# stplr-core

## 0.2.0-alpha.23

### Patch Changes

- Fix interactive auth processes hanging

## 0.2.0-alpha.22

### Patch Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ export const isGitHubAuthenticated = (): boolean => {
export const authenticateGitHub = async () => {
await logger.withSpinner('github', 'Attempting to authenticate...', async (spinner) => {
try {
spinner.stop();

execSync('gh auth login', { stdio: 'inherit' });

spinner.start('Authenticating...');
const isAuthenticated = isGitHubAuthenticated();
if (isAuthenticated) {
spinner.succeed('Authentication successful.');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { execAsync } from "../../../utils/execAsync";
import { logger } from "../../../utils/logger";
import { execSync } from 'child_process';
import { execAsync } from '../../../utils/execAsync';
import { logger } from '../../../utils/logger';

export const loginToSupabase = async () => {
await logger.withSpinner('supabase', 'Logging in...', async (spinner) => {
Expand All @@ -8,7 +9,9 @@ export const loginToSupabase = async () => {
spinner.succeed('Already logged in.');
} catch (error) {
try {
await execAsync('npx supabase login');
spinner.stop();
execSync('npx supabase login', { stdio: 'inherit' });
spinner.start('Logging in...');
spinner.succeed('Logged in successfully.');
} catch {
spinner.fail('Failed to log in to Supabase.');
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stplr-core",
"version": "0.2.0-alpha.22",
"version": "0.2.0-alpha.23",
"private": true,
"main": "./dist/index.js",
"scripts": {
Expand Down

0 comments on commit a357704

Please sign in to comment.