import os
from synthtool import shell
from pathlib import Path

# Parent of the script is the API-specific directory
# Parent of the API-specific directory is the apis directory
# Parent of the apis directory is the repo root
root = Path(__file__).parent.parent.parent
package = Path(__file__).parent.name

shell.run(
  f'"C:\\Program Files\\Git\\bin\\bash.exe" generateapis.sh {package}',
  cwd = root,
  hide_output = False)

import sys
from synthtool import shell
from pathlib import Path

# Parent of the script is the API-specific directory
# Parent of the API-specific directory is the apis directory
# Parent of the apis directory is the repo root
root = Path(__file__).parent.parent.parent
package = Path(__file__).parent.name

bash = '/bin/bash'
if sys.platform == 'win32':
  bash = '"C:\\Program Files\\Git\\bin\\bash.exe"'

shell.run(
  f'{bash} generateapis.sh {package}',
  cwd = root,
  hide_output = False)

Use the right bash command based on platform
Use the right bash command based on platform

- import os
+ import sys
  from synthtool import shell
  from pathlib import Path
  
  # Parent of the script is the API-specific directory
  # Parent of the API-specific directory is the apis directory
  # Parent of the apis directory is the repo root
  root = Path(__file__).parent.parent.parent
  package = Path(__file__).parent.name
  
+ bash = '/bin/bash'
+ if sys.platform == 'win32':
+   bash = '"C:\\Program Files\\Git\\bin\\bash.exe"'
+ 
  shell.run(
-   f'"C:\\Program Files\\Git\\bin\\bash.exe" generateapis.sh {package}',
+   f'{bash} generateapis.sh {package}',
    cwd = root,
    hide_output = False)
  
Use the right bash command based on platform
## Code Before:
import os
from synthtool import shell
from pathlib import Path

# Parent of the script is the API-specific directory
# Parent of the API-specific directory is the apis directory
# Parent of the apis directory is the repo root
root = Path(__file__).parent.parent.parent
package = Path(__file__).parent.name

shell.run(
  f'"C:\\Program Files\\Git\\bin\\bash.exe" generateapis.sh {package}',
  cwd = root,
  hide_output = False)

## Instruction:
Use the right bash command based on platform
## Code After:
import sys
from synthtool import shell
from pathlib import Path

# Parent of the script is the API-specific directory
# Parent of the API-specific directory is the apis directory
# Parent of the apis directory is the repo root
root = Path(__file__).parent.parent.parent
package = Path(__file__).parent.name

bash = '/bin/bash'
if sys.platform == 'win32':
  bash = '"C:\\Program Files\\Git\\bin\\bash.exe"'

shell.run(
  f'{bash} generateapis.sh {package}',
  cwd = root,
  hide_output = False)
