mirror of
https://github.com/mwpenny/portal64-still-alive.git
synced 2024-10-20 10:37:37 -04:00
fa0940fe90
Incidental changes along the way: * Move `export_level.lua` to `tools/level_scripts/` * Small reorganizations/fixes to existing `CMakeLists.txt` files * Support passing absolute paths to level export
19 lines
467 B
Lua
19 lines
467 B
Lua
local util = require('tools.level_scripts.util')
|
|
local yaml = require('yaml')
|
|
local sk_input = require('sk_input')
|
|
|
|
local file_stem = sk_input.input_filename:match(".+[\\/]([^\\.]+)")
|
|
local file_location = util.path_join(
|
|
"assets",
|
|
"test_chambers",
|
|
file_stem,
|
|
file_stem .. ".yaml"
|
|
)
|
|
|
|
local input_file = io.open(file_location, 'r')
|
|
local json_contents = yaml.parse(input_file:read('a'))
|
|
input_file:close()
|
|
|
|
return {
|
|
json_contents = json_contents,
|
|
} |