]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Fix modified files only (frontend)
authorPatrick Nawracay <pnawracay@suse.com>
Fri, 30 Nov 2018 15:37:59 +0000 (16:37 +0100)
committerPatrick Nawracay <pnawracay@suse.com>
Fri, 1 Feb 2019 08:02:59 +0000 (09:02 +0100)
Introduces a new npm command: `npm run fixmod` which, unlike `npm run
fix`, only fixes modified files in the current git repository.  This is
faster than the comprehensive `npm run fix` solution and can hence be
called more often with less disturbance.

Signed-off-by: Patrick Nawracay <pnawracay@suse.com>
src/pybind/mgr/dashboard/frontend/package.json

index 481972229f7dfecbdec06d275864b7c6e9dcbedb..b2fa350ea2c394944ac0627fa3039653286ddfa4 100644 (file)
@@ -18,6 +18,7 @@
     "lint": "npm run lint:tslint && npm run lint:prettier && npm run lint:html",
     "fix:prettier": "prettier --write \"{src,e2e}/**/*.{ts,scss}\"",
     "fix:tslint": "npm run lint:tslint -- --fix",
+    "fixmod": "prettier --write $(git rev-parse --show-toplevel)/$(git status --porcelain | grep -E '^(\\sM|\\?\\?|A)' | sed -e 's/^...//' | grep -E '^(src|e2e).*\\.(ts|scss)$') 1>/dev/null 2>&1 && echo 'done' || echo 'no changes found'",
     "fix": "npm run fix:tslint; npm run fix:prettier"
   },
   "private": true,