-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathz_widdershins_recursive.py
45 lines (24 loc) · 1.52 KB
/
z_widdershins_recursive.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#from unipath import Path
import os
#import shutil
import subprocess
# CircleCI will run this script first
# Widdershins Swaggerfile converter for Dev Center
# This script will run first, to convert Swagger.json files to a fresh set of Swagger.json.md files.
# Dev Center Repo - Swagger Files for API Explorer
# swagger_v3_0 = Path (r"C:\Users\I860605\Desktop\Dev_Center_New\dev_concur\src\api-explorer\v3-0").listdir()
# swagger_v3_1 = Path (r"C:\Users\I860605\Desktop\Dev_Center_New\dev_concur\src\api-explorer\v3-1").listdir()
# swagger_v3_2 = Path (r"C:\Users\I860605\Desktop\Dev_Center_New\dev_concur\src\api-explorer\v3-2").listdir()
# swagger_v4_0 = Path (r"C:\Users\I860605\Desktop\Dev_Center_New\dev_concur\src\api-explorer\v4-0").listdir()
# All markdown files in the 'includes' folder in Slate portion of the Dev Center repo
#to_slate_repo_includes = Path(r"C:\Users\I860605\Desktop\Dev_Center_New\dev_concur\src\Slate-API-Explorer-Reference\slate\source\includes")
# Detecting and converting the Swagger files in all sub-folders under the 'api-explorer' folder
def convertSwaggerToMarkdown():
#cmd = 'For /R \\src\\api-explorer\\ %G IN (*.json) do widdershins "%G" -o "%G".md'
cmd = 'For /R C:\\Users\\I860605\\Desktop\\dev-center-test\\dev-concur-test\\src\\api-explorer\\ %G IN (*.json) do widdershins "%G" -o "%G".md'
#subprocess.call(cmd, shell=True)
subprocess.run(cmd, shell=True)
print("Files successfully converted to markdown")
def main():
convertSwaggerToMarkdown()
main()