Skip to content

Commit

Permalink
Merge pull request #362 from tschaub/cache-dir
Browse files Browse the repository at this point in the history
Move the cache directory
  • Loading branch information
tschaub authored Jun 20, 2020
2 parents 1625ce9 + 5d88feb commit 1517aef
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 5 deletions.
3 changes: 2 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const findCacheDir = require('find-cache-dir');
const Git = require('./git');
const filenamify = require('filenamify-url');
const copy = require('./util').copy;
Expand All @@ -10,7 +11,7 @@ const util = require('util');
const log = util.debuglog('gh-pages');

function getCacheDir() {
return path.relative(process.cwd(), path.resolve(__dirname, '../.cache'));
return findCacheDir({name: 'gh-pages'});
}

function getRepo(options) {
Expand Down
83 changes: 83 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"commander": "^2.18.0",
"email-addresses": "^3.0.1",
"filenamify-url": "^1.0.0",
"find-cache-dir": "^3.3.1",
"fs-extra": "^8.1.0",
"globby": "^6.1.0"
},
Expand Down
6 changes: 2 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,6 @@ Note that this plugin requires Git 1.9 or higher (because it uses the `--exit-co
name: 'ProcessError' }
```

When processing `gh-pages` module generate file in`.cache/` and if stuck some reason like wrong password
it will not automatically cleanup
The `gh-pages` module writes temporary files to a `node_modules/.cache/gh-pages` directory. The location of this directory can be customized by setting the `CACHE_DIR` environemnt variable.

Run `~node_modules/gh-pages/bin/gh-pages-clean`
or remove `~node_modules/gh-pages/.cache`
If `gh-pages` fails, you may find that you need to manually clean up the cache directory. To remove the cache directory, run `node_modules/gh-pages/bin/gh-pages-clean` or remove `node_modules/.cache/gh-pages`.

0 comments on commit 1517aef

Please sign in to comment.