Skip to content
Permalink
Browse files

remove sourcing of .gitignore. Closes #557

.upignore and dotfiles are now the only filters. please comment on #557
if you object to this and explain why
  • Loading branch information...
tj committed Feb 3, 2018
1 parent 382d462 commit 017c53f74bc3d445901ca6f3bfb762812a120626
Showing with 2 additions and 22 deletions.
  1. +1 −14 docs/04-configuration.md
  2. +1 −1 docs/08-troubleshooting.md
  3. +0 −7 internal/zip/zip.go
@@ -668,10 +668,7 @@ By default Up treats stdout as `info` level logs, and stderr as `error` level. I

## Ignoring Files

Up supports gitignore style pattern matching for omitting files from deployment. The following files are loaded in sequence:

- .gitignore
- .upignore
Up supports gitignore style pattern matching for omitting files from deployment, via the `.upignore` file.

An example `.upignore` to omit markdown and `.go` source files might look like this:

@@ -715,16 +712,6 @@ DEBU filtered node_modules/chalk/readme.md – 6136

You may also wish to use `up build --size` to view the largest files within the zip.

### Node specifics

When building a Node project, `node_modules` is often added to `.gitignore`, so Up special-cases this scenario so that `node_modules` is not excluded by default.

If you're using a bundler such as Webpack or Browserify instead, you may wish to ignore `node_modules` as they're not required in production, add this to your `./.upignore`:

```
node_modules
```

### Pattern matching

Note that patterns are matched much like `.gitignore`, so if you have the following `.upignore` contents even `node_modules/debug/src/index.js` will be ignored since it contains `src`.
@@ -15,7 +15,7 @@ title: Help

<details>
<summary>I'm seeing 404 Not Found responses</summary>
<p>By default Up ignores files which are found in `.gitignore`. Use the verbose flag such as `up -v` to see if files have been filtered, or `up build --size` to see a list of files within the zip sorted by size. See [Ignoring Files](#configuration.ignoring_files) for more information.</p>
<p>By default Up ignores files which are found in `.upignore`. Use the verbose flag such as `up -v` to see if files have been filtered, or `up build --size` to see a list of files within the zip sorted by size. See [Ignoring Files](#configuration.ignoring_files) for more information.</p>
</details>

<details>
@@ -27,12 +27,6 @@ var transform = archive.TransformFunc(func(r io.Reader, i os.FileInfo) (io.Reade

// Build the given `dir`.
func Build(dir string) (io.ReadCloser, *archive.Stats, error) {
gitignore, err := read(".gitignore")
if err != nil {
return nil, nil, errors.Wrap(err, "reading .gitignore")
}
defer gitignore.Close()

upignore, err := read(".upignore")
if err != nil {
return nil, nil, errors.Wrap(err, "reading .upignore")
@@ -41,7 +35,6 @@ func Build(dir string) (io.ReadCloser, *archive.Stats, error) {

r := io.MultiReader(
strings.NewReader(".*\n"),
gitignore,
strings.NewReader("\n!node_modules/**\n!.pypath/**\n"),
upignore,
strings.NewReader("\n!main\n!server\n!_proxy.js\n!byline.js\n!up.json\n!pom.xml\n!build.gradle\n!project.clj\n"))

0 comments on commit 017c53f

Please sign in to comment.
You can’t perform that action at this time.