Skip to content

Commit

Permalink
Add an option to copy symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
OlliV committed Dec 30, 2016
1 parent 02b0a9e commit 57a9a38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions bin/now-deploy.js
Expand Up @@ -39,6 +39,7 @@ const argv = minimist(process.argv.slice(2), {
'version',
'debug',
'force',
'links',
'login',
'no-clipboard',
'forward-npm',
Expand All @@ -55,6 +56,7 @@ const argv = minimist(process.argv.slice(2), {
force: 'f',
token: 't',
forceSync: 'F',
links: 'l',
login: 'L',
public: 'p',
'no-clipboard': 'C',
Expand Down Expand Up @@ -90,6 +92,7 @@ const help = () => {
-f, --force Force a new deployment even if nothing has changed
-t ${chalk.underline('TOKEN')}, --token=${chalk.underline('TOKEN')} Login token
-L, --login Configure login
-l, --links Copy symlinks without resolving their target
-p, --public Deployment is public (${chalk.dim('`/_src`')} is exposed) [on for oss, off for premium]
-e, --env Include an env var (e.g.: ${chalk.dim('`-e KEY=value`')}). Can appear many times.
-C, --no-clipboard Do not attempt to copy URL to clipboard
Expand Down Expand Up @@ -158,6 +161,7 @@ const clipboard = !argv['no-clipboard']
const forwardNpm = argv['forward-npm']
const forceSync = argv.forceSync
const shouldLogin = argv.login
const followSymlinks = !argv.links
const wantsPublic = argv.public
const deploymentName = argv.name || false
const apiUrl = argv.url || 'https://api.zeit.co'
Expand Down Expand Up @@ -459,6 +463,7 @@ async function sync(token) {
env,
deploymentType,
deploymentName,
followSymlinks,
forceNew,
forceSync,
forwardNpm: alwaysForwardNpm || forwardNpm,
Expand Down
5 changes: 3 additions & 2 deletions lib/index.js
Expand Up @@ -10,7 +10,7 @@ import resumer from 'resumer'
import retry from 'async-retry'
import splitArray from 'split-array'
import {parse as parseIni} from 'ini'
import {readFile, stat} from 'fs-promise'
import {readFile, stat, lstat} from 'fs-promise'

// Ours
import {npm as getNpmFiles, docker as getDockerFiles} from './get-files'
Expand Down Expand Up @@ -40,6 +40,7 @@ export default class Now extends EventEmitter {
wantsPublic,
quiet = false,
env = {},
followSymlinks = true,
forceNew = false,
forceSync = false,
forwardNpm = false,
Expand Down Expand Up @@ -132,7 +133,7 @@ export default class Now extends EventEmitter {
name = this.pathInsideContent(name)
}

const st = await stat(name)
const st = await (followSymlinks ? stat(name) : lstat(name))

return {
sha,
Expand Down

0 comments on commit 57a9a38

Please sign in to comment.