
import os
import subprocess
import sys

def run():
  toolchain = os.getenv('TOOLCHAIN')
  if not toolchain:
    sys.exit('Environment variable TOOLCHAIN is empty')

  build_type = os.getenv('BUILD_TYPE')
  if not build_type:
    sys.exit('Environment variable BUILD_TYPE is empty')

  build = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'build.py')

  print('Run script: {}'.format(build))
  print('Toolchain: {}'.format(toolchain))
  print('Config: {}'.format(build_type))

  args = [
      sys.executable,
      build,
      '--toolchain',
      toolchain,
      '--config',
      build_type,
      '--verbose',
      '--test'
  ]

  try:
    subprocess.check_call(args)
  except subprocess.CalledProcessError as error:
    print(error)
    print(error.output)
    sys.exit(1)


import os
import subprocess
import sys

def run():
  toolchain = os.getenv('TLC')
  if not toolchain:
    sys.exit('Environment variable TLC is empty (TooLChain)')

  config = os.getenv('CFG')
  if not config:
    sys.exit('Environment variable CFG is empty (ConFiG)')

  build = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'build.py')

  print('Run script: {}'.format(build))
  print('Toolchain: {}'.format(toolchain))
  print('Config: {}'.format(config))

  args = [
      sys.executable,
      build,
      '--toolchain',
      toolchain,
      '--config',
      config,
      '--verbose',
      '--test'
  ]

  try:
    subprocess.check_call(args)
  except subprocess.CalledProcessError as error:
    print(error)
    print(error.output)
    sys.exit(1)

Use short axis names to prevent windows path overflow
Use short axis names to prevent windows path overflow

  
  import os
  import subprocess
  import sys
  
  def run():
-   toolchain = os.getenv('TOOLCHAIN')
+   toolchain = os.getenv('TLC')
    if not toolchain:
-     sys.exit('Environment variable TOOLCHAIN is empty')
+     sys.exit('Environment variable TLC is empty (TooLChain)')
  
-   build_type = os.getenv('BUILD_TYPE')
-   if not build_type:
+   config = os.getenv('CFG')
+   if not config:
-     sys.exit('Environment variable BUILD_TYPE is empty')
+     sys.exit('Environment variable CFG is empty (ConFiG)')
  
    build = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'build.py')
  
    print('Run script: {}'.format(build))
    print('Toolchain: {}'.format(toolchain))
-   print('Config: {}'.format(build_type))
+   print('Config: {}'.format(config))
  
    args = [
        sys.executable,
        build,
        '--toolchain',
        toolchain,
        '--config',
-       build_type,
+       config,
        '--verbose',
        '--test'
    ]
  
    try:
      subprocess.check_call(args)
    except subprocess.CalledProcessError as error:
      print(error)
      print(error.output)
      sys.exit(1)
  
Use short axis names to prevent windows path overflow
## Code Before:

import os
import subprocess
import sys

def run():
  toolchain = os.getenv('TOOLCHAIN')
  if not toolchain:
    sys.exit('Environment variable TOOLCHAIN is empty')

  build_type = os.getenv('BUILD_TYPE')
  if not build_type:
    sys.exit('Environment variable BUILD_TYPE is empty')

  build = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'build.py')

  print('Run script: {}'.format(build))
  print('Toolchain: {}'.format(toolchain))
  print('Config: {}'.format(build_type))

  args = [
      sys.executable,
      build,
      '--toolchain',
      toolchain,
      '--config',
      build_type,
      '--verbose',
      '--test'
  ]

  try:
    subprocess.check_call(args)
  except subprocess.CalledProcessError as error:
    print(error)
    print(error.output)
    sys.exit(1)

## Instruction:
Use short axis names to prevent windows path overflow
## Code After:

import os
import subprocess
import sys

def run():
  toolchain = os.getenv('TLC')
  if not toolchain:
    sys.exit('Environment variable TLC is empty (TooLChain)')

  config = os.getenv('CFG')
  if not config:
    sys.exit('Environment variable CFG is empty (ConFiG)')

  build = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'build.py')

  print('Run script: {}'.format(build))
  print('Toolchain: {}'.format(toolchain))
  print('Config: {}'.format(config))

  args = [
      sys.executable,
      build,
      '--toolchain',
      toolchain,
      '--config',
      config,
      '--verbose',
      '--test'
  ]

  try:
    subprocess.check_call(args)
  except subprocess.CalledProcessError as error:
    print(error)
    print(error.output)
    sys.exit(1)
