
The add-on code was copy-pasted from other addons and used the GPL v2 license, whereas by accident the LICENSE text file had the GNU "Affero" GPL license v3 (instead of regular GPL v3). This is now all streamlined, and all code is licensed as "GPL v3 or later". Furthermore, the code comments just show a SPDX License Identifier instead of an entire license block.
27 lines
707 B
Go
27 lines
707 B
Go
package job_compilers
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
import (
|
|
"git.blender.org/flamenco/pkg/crosspath"
|
|
"github.com/dop251/goja"
|
|
"github.com/rs/zerolog/log"
|
|
)
|
|
|
|
// PathModule provides file path manipulation functions by wrapping Go's `path`.
|
|
func PathModule(r *goja.Runtime, module *goja.Object) {
|
|
obj := module.Get("exports").(*goja.Object)
|
|
|
|
mustExport := func(name string, value interface{}) {
|
|
err := obj.Set(name, value)
|
|
if err != nil {
|
|
log.Panic().Err(err).Msgf("unable to register '%s' in Goja 'path' module", name)
|
|
}
|
|
}
|
|
|
|
mustExport("basename", crosspath.Base)
|
|
mustExport("dirname", crosspath.Dir)
|
|
mustExport("join", crosspath.Join)
|
|
mustExport("stem", crosspath.Stem)
|
|
}
|