Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/codegen.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ const generateOperationFile = (config, operation, operation_name) => new Promise
if (err) return reject(err);
const subdir = config.root.replace(new RegExp(`${config.templates_dir}[/]?`),'');
const new_filename = config.file_name.replace('___', operation_name);
const target_file = path.resolve(config.target_dir, subdir, new_filename);
const target_file_path = path.join(config.target_dir, subdir.replace(config.templates_dir, ''));
xfs.mkdirpSync(target_file_path)
const target_file = path.resolve(target_file_path, new_filename);
const template = Handlebars.compile(data.toString());

const content = template({
Expand Down