ArkEcosystem / core

The ARK Core Blockchain Framework. Check https://learn.ark.dev for more information.
https://ark.io
MIT License
337 stars 286 forks source link

Pre-commit script - package.json not found in core-deployer #2017

Closed Nigui closed 5 years ago

Nigui commented 5 years ago

Describe the bug

The pre-commit script calls generateConfig.js script. This script generates the config.yml file for circleci. A non-blocking error is thrown during the generation, due to the missing package.json file in the core-deployer package. The script stops and config file is not generated (which can be a problem ?)

To Reproduce Steps to reproduce the behavior:

  1. Checkout develop
  2. make changes (touch tmp)
  3. add/commit (`git add . && git commit -m "tmp")
  4. Look at console logs

Expected behavior

Error mustn't be thrown. Maybe skip core-deployer folder ?

Logs

husky > pre-commit (node v10.14.1)
  ↓ Stashing changes... [skipped]
    → No partially staged files found...
  ✔ Running linters...
Running pre-commit script...
internal/modules/cjs/loader.js:582
    throw err;
    ^

Error: Cannot find module '/Users/g-space/Documents/projects/ark/core/packages/core-deployer/package.json'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
    at Function.Module._load (internal/modules/cjs/loader.js:506:25)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at pkgs.map.filter.pkg (/Users/g-space/Documents/projects/ark/core/.circleci/generateConfig.js:50:25)
    at Array.filter (<anonymous>)
    at jobs.forEach (/Users/g-space/Documents/projects/ark/core/.circleci/generateConfig.js:47:18)
    at Array.forEach (<anonymous>)
    at fs.readdir (/Users/g-space/Documents/projects/ark/core/.circleci/generateConfig.js:29:14)
    at FSReqWrap.oncomplete (fs.js:141:20)
pre-commit script was run succesfully
faustbrian commented 5 years ago

Deployer doesn't exist anymore in this repository anymore, hasn't for weeks, no clue what revision you are using.

alexbarnsley commented 5 years ago

@Nigui you likely need to remove the packages/core-deployer folder. Since it was removed on the develop branch, the folder will still be there with node_modules in it.