#! /bin/bash fail() { echo "Error: $1" exit "${2-1}" ## Return a code specified by $2, or 1 by default. } ## Run the script-placer.sh for each repository in the success.txt file IGNORE_REPOS=( "glob-parent" "is-glob" "mime-types" "doctrine" "define-property" "jsonfile" "optionator" "http-errors" "type-check" "levn" "is-extendable" "esquery" "on-finished" "error-ex" "finalhandler" "content-disposition" "terser" "proxy-addr" "prop-types" "has-values" "has-value" "url-parse" "simple-swizzle" "compressible" "global-modules" "thenify" "mz" "clone-deep" "shallow-clone" "prettier-linter-helpers" "cors" "fd-slicer" "object.pick" "language-tags" "union-value" "object-copy" "static-extend" "memory-fs" "pinkie-promise" "hash.js" "pretty-error" "renderkid" "wbuf" "browserify-zlib" "hmac-drbg" "des.js" "dom-converter" "expand-tilde" "homedir-polyfill" "zip-stream" "crc32-stream" "one-time" "resolve-dir" "yargs-unparser" "# warning" "bplist-parser" "for-own" "md5" "is-relative" "is-absolute" "is-unc-path" "redis-parser" "recursive-readdir" "path-root" "lazy-cache" "# css-to-react-native" "parse-filepath" "request-progress" "jest-junit" "postcss-initial" "unixify" "cookie-parser" "saslprep" "window-size" "cookies" "keygrip" "contains-path" "fined" "object.defaults" "is-color-stop" "gonzales-pe" "bufferutil" "make-iterator" "glob-base" "uid-safe" "fancy-log" "object.map" "object.omit" "find-babel-config" "utf-8-validate" "mquery" "xlsx" "json-to-pretty-yaml" "easy-table" "named-placeholders" "is-dotfile" "parse-glob" "plugin-error" "is-equal-shallow" "original" "detective-typescript" "detective-es6" "json2mq" "create-error-class" "detective-cjs" "to-through" "resolve-options" "ansi-gray" "bcrypt" "mixin-object" "optimize-css-assets-webpack-plugin" "ordered-read-streams" "sync-fetch" "to-absolute-glob" "glogg" "unique-stream" "align-text" "gulplog" "blob" "center-align" "right-align" "wkx" "chai-as-promised" "json-pointer" "has-glob" "# promptly" "hot-shots" "semver-greatest-satisfied-range" "each-props" "is2" "levenary" "airbnb-prop-types" "remove-bom-stream" "remove-bom-buffer" "dotenv-defaults" "rework" "vizion" "array-sort" "default-compare" "pad-right" "passport-local" "console.table" "cli-tableau" "condense-newlines" "requireg" "object.reduce" "properties-reader" "array-initial" "default-resolution" "collection-map" "ansi-red" "broccoli-merge-trees" "eslint-plugin-react-native" "is-valid-path" "strip-hex-prefix" "uglify-es" "ansi-cyan" "method-override" "# readline2" "number-allocator" "has-gulplog" "ethjs-util" "unescape" "validate.io-integer" "stream-parser" "compute-gcd" "validate.io-integer-array" "compute-lcm" "set-getter" "passport-oauth2" "i18n-iso-countries" "sha1" "json-diff" "dreamopt" "highlight-es" "basic-auth-connect" "glob2base" "third-party-capital" "new-date" "webrtc-adapter" "xhr-request-promise" "contentful-resolve-response" "jest-sonar-reporter" "parse-author" "amd-name-resolver" "mocha-multi-reporters" "eslint-plugin-filenames" "apache-crypt" "semver-intersect" "fetch-ponyfill" "karma-mocha" "is-odd" "babel-plugin-ember-modules-api-polyfill" "csurf" "taketalk" ) while read -r repo; do # if repo starts with a #, skip it if [[ "${IGNORE_REPOS[@]}" =~ "$repo" ]]; then echo "Skipping ignored repository: $repo" continue fi if [[ "$repo" =~ ^# ]]; then echo "Skipping comment line: $repo" continue fi if [[ -n "$repo" ]]; then # echo "Running script-placer.sh for repository: candidates/$repo" if [[ ! -d "../candidates-repos/$repo" ]]; then if [[ -d "candidates/$repo" ]]; then echo "Repository $repo exists in candidates, copying" pushd "candidates/$repo" rm -rf node_modules popd echo "Copying $repo to candidates-repos" cp -r "candidates/$repo" "../candidates-repos/$repo" || exit 1 else fail "Repository $repo does not exist in candidates or candidates-repos" fi continue fi echo "Analysing repository: $repo" echo "$repo" > current-processing.log ./script-placer.sh "../candidates-repos/$repo" || echo "Failed to process $repo" echo "Finished processing repository: $repo" else echo "Skipping empty repository entry" fi done < success.txt