*
()
| 22 | * |
| 23 | */ |
| 24 | function getCacheDirectory () { |
| 25 | const homeDir = os.homedir (); |
| 26 | let cachePath = ''; |
| 27 | if (process.platform === 'win32') { |
| 28 | cachePath = path.join (process.env.LOCALAPPDATA || path.join (homeDir, 'AppData', 'Local'), 'ccxt-cli', 'cache'); |
| 29 | } else if (process.platform === 'darwin') { // macOS |
| 30 | cachePath = path.join (homeDir, 'Library', 'Caches', 'ccxt-cli'); |
| 31 | } else { // Linux & Others |
| 32 | cachePath = path.join (process.env.XDG_CACHE_HOME || path.join (homeDir, '.cache'), 'ccxt-cli'); |
| 33 | } |
| 34 | if (!fs.existsSync (cachePath)) { |
| 35 | fs.mkdirSync (cachePath, { |
| 36 | 'recursive': true, |
| 37 | }); |
| 38 | } |
| 39 | return cachePath; |
| 40 | } |
| 41 | |
| 42 | function getCachePathForHelp () { |
| 43 | loadMainConfigFile (); |
no outgoing calls
no test coverage detected
searching dependent graphs…