Sha256: 6921d0f93eff4867a419c33ba560c736bb2461bd03ff2fa1da6f1a07031dc939

Contents?: true

Size: 607 Bytes

Versions: 7

Compression:

Stored size: 607 Bytes

Contents

const fs = require('./fs.js')
const getOptions = require('./common/get-options.js')
const owner = require('./common/owner.js')

const copyFile = async (src, dest, opts) => {
  const options = getOptions(opts, {
    copy: ['mode', 'owner'],
    wrap: 'mode',
  })

  const { uid, gid } = await owner.validate(dest, options.owner)

  // the node core method as of 16.5.0 does not support the mode being in an
  // object, so we have to pass the mode value directly
  const result = await fs.copyFile(src, dest, options.mode)

  await owner.update(dest, uid, gid)

  return result
}

module.exports = copyFile

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
disco_app-0.16.1 test/dummy/node_modules/@npmcli/fs/lib/copy-file.js
disco_app-0.15.2 test/dummy/node_modules/@npmcli/fs/lib/copy-file.js
disco_app-0.18.4 test/dummy/node_modules/@npmcli/fs/lib/copy-file.js
disco_app-0.18.1 test/dummy/node_modules/@npmcli/fs/lib/copy-file.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/@npmcli/fs/lib/copy-file.js
disco_app-0.14.0 test/dummy/node_modules/@npmcli/fs/lib/copy-file.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/@npmcli/fs/lib/copy-file.js