Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/commands/deploy/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { type Stats } from 'fs'
import { stat } from 'fs/promises'
import { basename, resolve } from 'path'
import { stdin, stdout } from 'process'

import type { NetlifyAPI } from '@netlify/api'
import { type NetlifyConfig, type OnPostBuild, runCoreSteps } from '@netlify/build'
Expand Down Expand Up @@ -118,6 +119,14 @@ const getDeployFolder = async ({
}

if (!deployFolder) {
if (!stdin.isTTY || !stdout.isTTY) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Might be nice to abstract this to a isInteractive method that we use in the different places we're checking this to ensure consistent behaviour. I could also see us introducing an explicit flag to control this behaviour (similar to npm's --yes) and that would make it easier to integrate. Not a blocker, though.

// non interactive - can't get the value, resolve to the cwd
if (command.workspacePackage) {
return command.jsWorkspaceRoot || site.root
}
return command.workingDir
}

log('Please provide a publish directory (e.g. "public" or "dist" or "."):')

// Generate copy-pasteable command with current options
Expand Down