feat: Convert all app files to JS
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import path from 'node:path';
|
||||
import defineAction from '../../../../helpers/define-action';
|
||||
import defineAction from '../../../../helpers/define-action.js';
|
||||
|
||||
export default defineAction({
|
||||
name: 'Rename file',
|
||||
@@ -9,25 +9,25 @@ export default defineAction({
|
||||
{
|
||||
label: 'File Path',
|
||||
key: 'filePath',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: true,
|
||||
description:
|
||||
'Write the full path to the file such as /Folder1/File.pdf',
|
||||
description: 'Write the full path to the file such as /Folder1/File.pdf',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'New Name',
|
||||
key: 'newName',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: true,
|
||||
description: "Enter the new name for the file (without the extension, e.g., '.pdf')",
|
||||
description:
|
||||
"Enter the new name for the file (without the extension, e.g., '.pdf')",
|
||||
variables: true,
|
||||
},
|
||||
],
|
||||
|
||||
async run($) {
|
||||
const filePath = $.step.parameters.filePath as string;
|
||||
const newName = $.step.parameters.newName as string;
|
||||
const filePath = $.step.parameters.filePath;
|
||||
const newName = $.step.parameters.newName;
|
||||
const fileObject = path.parse(filePath);
|
||||
const newPath = path.format({
|
||||
dir: fileObject.dir,
|
Reference in New Issue
Block a user