haikuwebkit/Source/WebInspectorUI/Scripts/remove-console-asserts-dryr...

24 lines
793 B
Ruby
Raw Permalink Normal View History

Replace hard-coded paths in shebangs with #!/usr/bin/env https://bugs.webkit.org/show_bug.cgi?id=181040 Patch by Ting-Wei Lan <lantw44@gmail.com> on 2018-01-03 Reviewed by Alex Christensen. .: * Source/cmake/tools/scripts/auto-version.pl: * Source/cmake/tools/scripts/feature-defines.pl: * Source/cmake/tools/scripts/version-stamp.pl: Source/JavaScriptCore: * Scripts/UpdateContents.py: * Scripts/cssmin.py: * Scripts/generate-combined-inspector-json.py: * Scripts/xxd.pl: * create_hash_table: * generate-bytecode-files: * wasm/generateWasm.py: * wasm/generateWasmOpsHeader.py: * yarr/generateYarrCanonicalizeUnicode: Source/WebCore: * bindings/scripts/InFilesCompiler.pm: * bindings/scripts/InFilesParser.pm: * bindings/scripts/generate-bindings-all.pl: * bindings/scripts/generate-bindings.pl: * bindings/scripts/preprocess-idls.pl: * css/make-css-file-arrays.pl: * css/makeprop.pl: * css/makevalues.pl: * dom/make_event_factory.pl: * dom/make_names.pl: * extract-localizable-strings.pl: * make-hash-tools.pl: Source/WebCore/PAL: * AVFoundationSupport.py: Source/WebInspectorUI: * Scripts/combine-resources.pl: * Scripts/copy-user-interface-resources-dryrun.rb: * Scripts/copy-user-interface-resources.pl: * Scripts/fix-worker-imports-for-optimized-builds.pl: * Scripts/remove-console-asserts-dryrun.rb: * Scripts/remove-console-asserts.pl: * Scripts/update-LegacyInspectorBackendCommands.rb: * Scripts/update-codemirror-resources.rb: * WebInspectorUI.vcxproj/build-webinspectorui.pl: Source/WebKit: * Scripts/generate-forwarding-headers.pl: Source/WebKitLegacy: * scripts/generate-webkitversion.pl: Tools: * BuildSlaveSupport/build-launcher-app: * BuildSlaveSupport/build-launcher-dmg: * BuildSlaveSupport/build.webkit.org-config/steps_unittest.py: * BuildSlaveSupport/built-product-archive: * BuildSlaveSupport/clean-build: * BuildSlaveSupport/delete-stale-build-files: * BuildSlaveSupport/download-built-product: * BuildSlaveSupport/gtk/buildbot/log/run: * BuildSlaveSupport/gtk/buildbot/run: * BuildSlaveSupport/gtk/pulseaudio/run: * BuildSlaveSupport/kill-old-processes: * BuildSlaveSupport/test-result-archive: * BuildSlaveSupport/win/kill-old-processes: * Scripts/SpacingHeuristics.pm: * Scripts/add-include: * Scripts/build-api-tests: * Scripts/build-dumprendertree: * Scripts/build-imagediff: * Scripts/build-jsc: * Scripts/build-webkit: * Scripts/build-webkittestrunner: * Scripts/check-Xcode-source-file-types: * Scripts/check-dom-results: * Scripts/check-for-exit-time-destructors: * Scripts/check-for-global-initializers: * Scripts/check-for-inappropriate-objc-class-names: * Scripts/check-for-weak-vtables-and-externals: * Scripts/clean-header-guards: * Scripts/compare-timing-files: * Scripts/configure-xcode-for-ios-development: * Scripts/copy-webkitlibraries-to-product-directory: * Scripts/create-exports: * Scripts/debug-minibrowser: * Scripts/debug-safari: * Scripts/debug-test-runner: * Scripts/do-file-rename: * Scripts/do-webcore-rename: * Scripts/dump-webkit-tests-run: * Scripts/ensure-valid-python: * Scripts/execAppWithEnv: * Scripts/extract-localizable-js-strings: * Scripts/filter-build-webkit: * Scripts/find-extra-includes: * Scripts/fix-blink-patch: * Scripts/generate-coverage-data: * Scripts/git-add-reviewer: * Scripts/jsc-stress-test-helpers/js-exception-fuzz: * Scripts/jsc-stress-test-helpers/js-executable-allocation-fuzz: * Scripts/jsc-stress-test-helpers/js-osr-exit-fuzz: * Scripts/make-new-script-test: * Scripts/make-script-test-wrappers: * Scripts/package-root: * Scripts/parse-malloc-history: * Scripts/report-include-statistics: * Scripts/resolve-ChangeLogs: * Scripts/run-api-tests: * Scripts/run-bindings-tests: * Scripts/run-content-extension-tester: * Scripts/run-iexploder-tests: * Scripts/run-javascriptcore-tests: * Scripts/run-jsc: * Scripts/run-leaks: * Scripts/run-mangleme-tests: * Scripts/run-minibrowser: * Scripts/run-pageloadtest: * Scripts/run-regexp-tests: * Scripts/run-safari: * Scripts/run-sunspider: * Scripts/run-test-runner: * Scripts/run-webkit-app: * Scripts/run-webkit-httpd: * Scripts/run-webkit-websocketserver: * Scripts/set-webkit-configuration: * Scripts/show-pretty-diff: * Scripts/sort-Xcode-project-file: * Scripts/split-file-by-class: * Scripts/sunspider-compare-results: * Scripts/svn-apply: * Scripts/svn-unapply: * Scripts/test-webkit-scripts: * Scripts/test-webkitperl: * Scripts/update-iexploder-cssproperties: * Scripts/update-javascriptcore-test-results: * Scripts/update-webkit: * Scripts/update-webkit-auxiliary-libs: * Scripts/update-webkit-dependency: * Scripts/update-webkit-libs-jhbuild: * Scripts/update-webkit-localizable-strings: * Scripts/update-webkit-support-libs: * Scripts/update-webkitgtk-libs: * Scripts/update-webkitwpe-libs: * Scripts/webkit-build-directory: * Scripts/webkitperl/LoadAsModule.pm: * Scripts/webkitperl/VCSUtils_unittest/decodeGitBinaryPatch.pl: * Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl: * Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatchThenSetChangeLogDateAndReviewer.pl: * Scripts/webkitperl/VCSUtils_unittest/fixSVNPatchForAdditionWithHistory.pl: * Scripts/webkitperl/VCSUtils_unittest/generatePatchCommand.pl: * Scripts/webkitperl/VCSUtils_unittest/mergeChangeLogs.pl: * Scripts/webkitperl/VCSUtils_unittest/parseChunkRange.pl: * Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl: * Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl: * Scripts/webkitperl/VCSUtils_unittest/parseDiffWithMockFiles.pl: * Scripts/webkitperl/VCSUtils_unittest/parseFirstEOL.pl: * Scripts/webkitperl/VCSUtils_unittest/parseGitDiffHeader.pl: * Scripts/webkitperl/VCSUtils_unittest/parsePatch.pl: * Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffFooter.pl: * Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffHeader.pl: * Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl: * Scripts/webkitperl/VCSUtils_unittest/parseSvnPropertyValue.pl: * Scripts/webkitperl/VCSUtils_unittest/parseUnifiedDiffHeader.pl: * Scripts/webkitperl/VCSUtils_unittest/prepareParsedPatch.pl: * Scripts/webkitperl/VCSUtils_unittest/removeEOL.pl: * Scripts/webkitperl/VCSUtils_unittest/runCommand.pl: * Scripts/webkitperl/VCSUtils_unittest/runPatchCommand.pl: * Scripts/webkitperl/VCSUtils_unittest/setChangeLogDateAndReviewer.pl: * Scripts/webkitperl/auto-version_unittest/autoVersionTests.pl: * Scripts/webkitperl/auto-version_unittest/versionStampTests.pl: * Scripts/webkitperl/filter-build-webkit_unittest/shouldIgnoreLine_unittests.pl: * Scripts/webkitperl/prepare-ChangeLog_unittest/extractLineRangeBeforeAndAfterChange.pl: * Scripts/webkitperl/prepare-ChangeLog_unittest/fetchRadarURLFromBugXMLData.pl: * Scripts/webkitperl/prepare-ChangeLog_unittest/generateFunctionLists.pl: * Scripts/webkitperl/prepare-ChangeLog_unittest/parser_unittests.pl: * Scripts/webkitperl/prepare-ChangeLog_unittest/resources/perl_unittests.pl: * Scripts/webkitperl/run-leaks_unittest/run-leaks-report-v1.0.pl: * Scripts/webkitperl/run-leaks_unittest/run-leaks-report-v2.0-new.pl: * Scripts/webkitperl/run-leaks_unittest/run-leaks-report-v2.0-old.pl: * Scripts/webkitperl/webkitdirs_unittest/appendToEnvironmentVariableList.pl: * Scripts/webkitperl/webkitdirs_unittest/checkForArgumentAndRemoveFromArrayRef.pl: * Scripts/webkitperl/webkitdirs_unittest/checkForArgumentAndRemoveFromArrayRefGettingValue.pl: * Scripts/webkitperl/webkitdirs_unittest/extractNonMacOSHostConfiguration.pl: * Scripts/webkitperl/webkitdirs_unittest/prependToEnvironmentVariableList.pl: * Scripts/webkitpy/layout_tests/servers/run_webkit_httpd.py: * ccache/ccache-clang: * ccache/ccache-clang++: * ccache/ccache-wrapper: * gtk/install-dependencies: * iExploder/iexploder-1.3.2/htdocs/iexploder.cgi: * iExploder/iexploder-1.3.2/htdocs/webserver.rb: * iExploder/iexploder-1.3.2/tools/lasthit.rb: * iExploder/iexploder-1.3.2/tools/osx_last_crash.rb: * iExploder/iexploder-1.3.2/tools/showtest.rb: * iExploder/iexploder-1.7.2/src/browser_harness.rb: * iExploder/iexploder-1.7.2/src/iexploder.cgi: * iExploder/iexploder-1.7.2/src/webserver.rb: * iExploder/iexploder-1.7.2/tools/lasthit.rb: * iExploder/iexploder-1.7.2/tools/osx_last_crash.rb: * wpe/install-dependencies: Canonical link: https://commits.webkit.org/197118@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-04 07:18:18 +00:00
#!/usr/bin/env ruby
require "find"
$verbose = ARGV.include?("--verbose");
$remove_console_asserts_path = File.expand_path File.join(File.dirname(__FILE__), "remove-console-asserts.pl")
$web_inspector_user_interface_path = File.expand_path File.join(File.dirname(__FILE__), "..", "UserInterface")
Find.find($web_inspector_user_interface_path) do |path|
# Skip directories, External, Images, and non-js.
next if File.directory?(path)
next if path =~ /\/(External|Images)\//
next if path !~ /\.js$/
# Run remove-console-asserts on each file.
puts "Checking: #{path} ..." if $verbose
output = %x{ perl '#{$remove_console_asserts_path}' --input-script '#{path}' --output-script /dev/null }
if !output.empty?
puts "#{File.basename(path)}:"
puts output
puts
end
end