Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(publish): Avoid errors when files are ignored by git (#2445)
Fixes #2151 Co-authored-by: Jamie Martin <jamie.martin@fireeye.com>
- Loading branch information
sunlanterns
and
Jamie Martin
committed
May 23, 2020
1 parent
c74ffa4
commit 448f2ae
Showing
6 changed files
with
42 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.log |
1 change: 1 addition & 0 deletions
1
commands/publish/__tests__/__fixtures__/no-interdependencies/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
"use strict"; | ||
|
||
const log = require("npmlog"); | ||
const path = require("path"); | ||
const slash = require("slash"); | ||
const childProcess = require("@lerna/child-process"); | ||
|
||
module.exports = gitAdd; | ||
|
||
function gitAdd(files, opts) { | ||
log.silly("gitAdd", files); | ||
|
||
const filePaths = files.map(file => slash(path.relative(opts.cwd, path.resolve(opts.cwd, file)))); | ||
|
||
return childProcess.exec("git", ["add", "--", ...filePaths], opts); | ||
return childProcess.exec("git", ["add", "--", "."], opts); | ||
} |