|
20 | 20 | { id: 'js', label: '.cdsrc.js', lang: 'js', group, code: jsStr },
|
21 | 21 | { id: 'yml', label: '.cdsrc.yaml', lang: 'yml', group, code: ymlStr },
|
22 | 22 | { id: 'env', label: '.env file', lang: 'properties', group, code: propStr },
|
23 |
| - { id: 'shl', label: 'Linux/macOS Shells', lang: 'sh', group, code: envStr, transient: true }, |
| 23 | + { id: 'shl', label: 'Linux/macOS Shells', lang: 'sh', group, code: 'export '+envStr, transient: true }, |
24 | 24 | { id: 'shp', label: 'Powershell', lang: 'powershell', group, code: '$Env:'+envStr, transient: true },
|
25 | 25 | { id: 'shw', label: 'Cmd Shell', lang: 'cmd', group, code: 'set '+envStr, transient: true }
|
26 | 26 | ]" />
|
|
80 | 80 | FloatingVue.options.themes.cfgPopper = { $extend: 'dropdown' }
|
81 | 81 |
|
82 | 82 | const slots = useSlots()
|
| 83 | + //@ts-expect-error |
83 | 84 | const slotVal = slots.default?.().at(0)?.children?.toString().trim() ?? 'error: provide <Config>your_key:value</Config>'
|
84 | 85 |
|
85 | 86 | const [key, val] = slotVal.split(/\s*[:=]\s*/)
|
|
117 | 118 | pkgStr.value = JSON.stringify(pkg, null, 2)
|
118 | 119 | jsStr.value = 'module.exports = ' + pkgStr.value.replace(/"(\w*?)":/g, '$1:')
|
119 | 120 | propStr.value = `${key}=${jsonVal ? JSON.stringify(jsonVal) : value}`
|
120 |
| - envStr.value = `${key.replaceAll('_', '__').replaceAll('.', '_').toUpperCase()}=${jsonVal ? JSON.stringify(jsonVal) : value}` |
| 121 | +
|
| 122 | + let envKey = key.replaceAll('_', '__').replaceAll('.', '_') |
| 123 | + if (/^[a-z_]+$/.test(envKey)) envKey = envKey.toUpperCase() // only uppercase if not camelCase |
| 124 | + envStr.value = `${envKey}=${jsonVal ? JSON.stringify(jsonVal) : value}` |
121 | 125 |
|
122 | 126 | javaAppyml.value = ymlStr.value = yaml.stringify(pkg)
|
123 | 127 | javaEnvStr.value = `-D${propStr.value}`
|
|
0 commit comments