lib/clean.js
function cleanupCache() {
  const cacheLocation = getUserCachePath(this.options);
  if (fse.existsSync(cacheLocation)) {
    if (this.serverless) {
      this.serverless.cli.log(`Removing static caches at: ${cacheLocation}`);
    }

    // Only remove cache folders that we added, just incase someone accidentally puts a weird
    // static cache location so we don't remove a bunch of personal stuff
    const promises = [];
    glob
      .sync([path.join(cacheLocation, '*slspyc/')], { mark: true, dot: false })
      .forEach(file => {
        promises.push(fse.removeAsync(file));
      });
    return BbPromise.all(promises);
  } else {
    if (this.serverless) {
      this.serverless.cli.log(`No static cache found`);
    }
    return BbPromise.resolve();
  }
}
function cleanupCache() {
  const cacheLocation = getUserCachePath(this.options);
  if (fse.existsSync(cacheLocation)) {
    if (this.serverless) {
      this.serverless.cli.log(`Removing static caches at: ${cacheLocation}`);
    }

    // Only remove cache folders that we added, just incase someone accidentally puts a weird
    // static cache location so we don't remove a bunch of personal stuff
    const promises = [];
    glob
      .sync([path.join(cacheLocation, '*slspyc/')], { mark: true, dot: false })
      .forEach(file => {
        promises.push(fse.removeAsync(file));
      });
    return BbPromise.all(promises);
  } else {
    if (this.serverless) {
      this.serverless.cli.log(`No static cache found`);
    }
    return BbPromise.resolve();
  }
}
function cleanupCache ( ) { const cacheLocation = getUserCachePath ( this . options ) ; if ( fse . existsSync ( cacheLocation ) ) { if ( this . serverless ) { this . serverless . cli . log ( ` ${ cacheLocation } ` ) ; } // Only remove cache folders that we added, just incase someone accidentally puts a weird // static cache location so we don't remove a bunch of personal stuff const promises = [ ] ; glob . sync ( [ path . join ( cacheLocation , '*slspyc/' ) ] , { mark : true , dot : false } ) . forEach ( file => { promises . push ( fse . removeAsync ( file ) ) ; } ) ; return BbPromise . all ( promises ) ; } else { if ( this . serverless ) { this . serverless . cli . log ( ` ` ) ; } return BbPromise . resolve ( ) ; } }
Clean up static cache, remove all items in there
@return {Promise}
Clean up static cache remove all items in there