feat: Convert all app files to JS

This commit is contained in:
Faruk AYDIN
2024-01-05 17:44:21 +01:00
parent b95478b635
commit 43dba351c3
1030 changed files with 5114 additions and 6436 deletions

View File

@@ -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,