Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added script #7394

Merged
merged 5 commits into from Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -37,7 +37,7 @@
"test-install": "scripts/test-install.sh",
"clean-docs": "rimraf new-docs && rimraf docs-api-json",
"generate-d-ts": "npm run clean-docs && api-extractor run --local --verbose",
"generate-docs": "npm run generate-d-ts && api-documenter markdown -i docs-api-json -o new-docs",
"generate-docs": "npm run generate-d-ts && api-documenter markdown -i docs-api-json -o new-docs && node utils/remove-tag.js",
"ensure-correct-devtools-protocol-revision": "ts-node -s scripts/ensure-correct-devtools-protocol-package",
"ensure-pinned-deps": "ts-node -s scripts/ensure-pinned-deps",
"test-types-file": "ts-node -s scripts/test-ts-definition-files.ts",
Expand Down
27 changes: 27 additions & 0 deletions utils/remove-tag.js
@@ -0,0 +1,27 @@
#!/usr/bin/env node
/**
* Copyright 2018 Google Inc. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2021 :)

*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const glob = require('glob');
const fs = require('fs');

// look for all .md files in the given location.
const files = glob.sync(`./new-docs/*.md`);

for (const file of files) {
const content = fs.readFileSync(file, 'utf8');
const updated = content.replace(/<!-- -->/g, '');
tasneemkoushar marked this conversation as resolved.
Show resolved Hide resolved
fs.writeFileSync(file, updated);
}