sh 报告在更深层目录中找到的所有package.json文件中包含未发布的模块。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 报告在更深层目录中找到的所有package.json文件中包含未发布的模块。相关的知识,希望对你有一定的参考价值。

#!/bin/bash

# List of unpublished modules.
# https://gist.githubusercontent.com/azer/db27417ee84b5f34a6ea/raw/50ab7ef26dbde2d4ea52318a3590af78b2a21162/gistfile1.txt

badModules=(abril-fatface ada after-time alert andthen anglicize ansi-codes atbash attr attrs available-slug background-image ballet binding bind-key blending-modes boxcars brick brick-browser brick-browserify-plugin brick-node browserify-length bud bud-babelify bud-browserify bud-concat bud-indexhtml bud-live-server call-all categorize-files center-box centered centered-cover-background change-object change-object-path checkfor circle cli-form cli-qa combiner comma-list comp concat config-doc core-modules cover-background create-temp-dir debounce-fn declarative-js default-debug delegate-dom dom-children dom-classes dom-event domflow domquery dom-select dom-style dom-tree dom-value door duba eksi-server eksi-sozluk english-time environ every-time expand-home-dir failing-code failing-line filename-id filter-stack findall first-val flat-glob flatten-array flickr-client flickr-favorites flickr-following flickr-generate-urls flickr-photo-brick flickr-photo-info flickr-photo-urls flickr-recent flickr-user flickr-user-feed fog format-date format-text fox functools genpkg get-json get-object-path gezi gezi-core go go-api-starter goodeggs-list goodeggs-login hide highkick htmlglue html-patcher iframe ignore-doc img indev indexhtml indexhtml-cli infinite-scroll install-module is-node iter join-params jsify json-resources just-a-browserify-server just-a-server just-next-tick juxt key-event keyname-of keynames kik kik-starter kurdish-time left-pad less-common-words level-client level-flush level-json level-json-cache level-json-wrapper limited-parallel-loop local-debug lowkick make-editable map matches-dom-selector measure-time media medium-author medium-post memdiff memoize-async memoize-sync memoize-with-leveldb meta-tags methodify midibin-api midi-instrument midi-sdk mime-of mix-objects most-common-turkish-words most-common-words mp3s new-chain new-command new-element new-empty-array new-error new-format new-list new-object new-partial new-prop new-pubsub new-range new-reactive new-struct next-time observer one on-key-press on-off ourtunes outer-html package-path parallel-loop parallelly parse-path pause-function personal-api play-audio playfair-display play-url post-data pref prettify-error prompt-input propertify property prova provinces pt-mono pt-serif pubsub radio-paradise-api random-color rdio-js-api read-cli-input read-json redux-starter refine-object relative-date remotely render-loop require-sdk right-pad rimraf-glob rm-rf rname rnd route-map run-after run-paralelly run-serially sanitize-object scrape-eksi scrape-pages scrape-url scraping-eksi scroll-bottom select-dom serial-loop serially set-content-type set-object-path setup-docker shell-jobs show-help show-version shuffle-array simple.io simulate-touch slug-to-title socks-browser soundcloud-stream stream-format strip styled style-dom style-format subscribe subscription title-from-url toba-batak-dictionary to-class-name toledo-chess to-slug to-title try-call turkish-alphabet turkish-synonyms-api turkish-time unique-now uniques userbook uzo validate-value variable-name video-canvas video-dimensions virtualbox virtual-glue virtual-html watch-array web-assets with-env wysiwyg youtube-video);
packageFiles=(`find . -name package.json`);
badCount=0;

echo -e "Searching ${#packageFiles[*]} package.json file(s) ..."

for package in ${packageFiles[*]};
do
  match=false;
  for module in ${badModules[*]};
  do
    grep "\"$module\"" $package > /dev/null;
    if [ $? == 0 ]
    then
      match=true;
      echo "Found module \"$module\" in $package";
    fi
  done;

  if [ $match == true ]
  then
    badCount=$((badCount + 1));
  fi
done;

echo "$badCount package.json file(s) matched"

以上是关于sh 报告在更深层目录中找到的所有package.json文件中包含未发布的模块。的主要内容,如果未能解决你的问题,请参考以下文章

如何找到所有可见的深层嵌套 ListView 项目?

递归查找目录下所有指定文件(包括深层目录)

我可以为 Google Data Studio 报告使用深层链接和/或在报告 URL 中传递数据源参数吗?

打印目录下所有的文件名(包含深层次目录)

归档报告,cypress.json 文件

如何在 Windows 批处理文件中使用 7zip 从 ZIP 存档中提取最后一个目录?