static-resource Commands
static-resource generate
Description for static-resource generate
Generates the metadata resource file in the specified directory or the current working directory. Static resource files must be contained in a parent directory called "staticresources" in your package directory. Either run this command from an existing directory of this name, or use the --output-dir flag to create one or point to an existing one.
Examples for static-resource generate
Generate the metadata file for a static resource called MyResource in the current directory:
1sf static-resource generate --name MyResourceSimilar to previous example, but specifies a MIME type of application/json:
1sf static-resource generate --name MyResource --type application/jsonGenerate the resource file in the "force-app/main/default/staticresources" directory:
1sf static-resource generate --name MyResource --output-dir force-app/main/default/staticresourcesUsage
- sf static-resource generate
- [--json]
- -n NAME
- [--type TYPE]
- [-d OUTPUT-DIR]
- [--api-version API-VERSION]
Flags
- --json
- Optional
-
Format output as json.
- Type: boolean
- -n | --name NAME
- Required
-
Name of the generated static resource.
This name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
- Type: option
- --type TYPE
- Optional
-
Content type (mime type) of the generated static resource.
Must be a valid MIME type such as application/json, application/javascript, application/zip, text/plain, text/css, etc.
- Type: option
- Default value: application/zip
- -d | --output-dir OUTPUT-DIR
- Optional
-
Directory for saving the created files.
The location can be an absolute path or relative to the current working directory. The default is the current directory.
- Type: option
- Default value: .
- --api-version API-VERSION
- Optional
-
Override the api version used for api requests made by this command
- Type: option
Aliases for static-resource generate
1force:staticresource:create