Skip to content

Commit

Permalink
fix: updated Location type to TokenLocation to be more specific
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Hancock <[email protected]>
  • Loading branch information
dylanspyer and benhancock committed Oct 19, 2024
1 parent 378756a commit f480ba1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/commands/login/login.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { OptionValues } from 'commander'

import { chalk, exit, getToken, log } from '../../utils/command-helpers.js'
import { Location } from '../../utils/types.js'
import { TokenLocation } from '../../utils/types.js'
import BaseCommand from '../base-command.js'

const msg = function (location: Location) {
const msg = function (location: TokenLocation) {
switch (location) {
case 'env':
return 'via process.env.NETLIFY_AUTH_TOKEN set in your terminal session'
Expand Down
4 changes: 2 additions & 2 deletions src/utils/command-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { clearSpinner, startSpinner } from '../lib/spinner.js'
import getGlobalConfig from './get-global-config.js'
import getPackageJson from './get-package-json.js'
import { reportError } from './telemetry/report-error.js'
import { Location } from './types.js'
import { TokenLocation } from './types.js'

/** The parsed process argv without the binary only arguments and flags */
const argv = process.argv.slice(2)
Expand Down Expand Up @@ -133,7 +133,7 @@ export const pollForToken = async ({
* @returns {Promise<[null|string, 'flag' | 'env' |'config' |'not found']>}
*/

export type tokenTuple = [string | null, Location]
export type tokenTuple = [string | null, TokenLocation]

export const getToken = async (tokenFromOptions?: string): Promise<tokenTuple> => {
// 1. First honor command flag --auth
Expand Down

0 comments on commit f480ba1

Please sign in to comment.