MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / set_env

Function set_env

utils/install.py:432–521  ·  view source on GitHub ↗
(args, compat)

Source from the content-addressed store, hash-verified

430
431
432def set_env(args, compat):
433 global CONST_env, CONST_env_path, CONST_lib_dir
434
435 CONST_env = """#!/bin/sh
436# wasmedge shell setup
437# affix colons on either side of $PATH to simplify matching
438case :"${1}": in
439 *:"{0}/bin":*)
440 ;;
441 *)
442 # Prepend the path in case a system-installed wasmedge needs to be overridden
443 if [ -n "${1}" ]; then
444 export PATH="{0}/bin:$PATH"
445 else
446 export PATH="{0}/bin"
447 fi
448 ;;
449esac
450case :"${2}": in
451 *:"{0}/{6}":*)
452 ;;
453 *)
454 # Prepend the path in case system-installed wasmedge libraries need to be overridden
455 if [ -n "${2}" ]; then
456 export {2}="{0}/{6}:${2}"
457 else
458 export {2}="{0}/{6}"
459 fi
460 ;;
461esac
462case :"${3}": in
463 *:"{0}/{6}":*)
464 ;;
465 *)
466 if [ -n "${3}" ]; then
467 export LIBRARY_PATH="{0}/{6}:$LIBRARY_PATH"
468 else
469 export LIBRARY_PATH="{0}/{6}"
470 fi
471 ;;
472esac
473case :"${4}": in
474 *:"{0}/include":*)
475 ;;
476 *)
477 if [ -n "${4}" ]; then
478 export C_INCLUDE_PATH="{0}/include:$C_INCLUDE_PATH"
479 else
480 export C_INCLUDE_PATH="{0}/include"
481 fi
482 ;;
483esac
484case :"${5}": in
485 *:"{0}/include":*)
486 ;;
487 *)
488 if [ -n "${5}" ]; then
489 export CPLUS_INCLUDE_PATH="{0}/include:$CPLUS_INCLUDE_PATH"

Callers 1

mainFunction · 0.85

Calls 4

is_default_pathFunction · 0.85
opened_w_errorFunction · 0.85
formatMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected