Skip to content

Commit

Permalink
Implement custom cml publish Domain
Browse files Browse the repository at this point in the history
  • Loading branch information
dacbd committed Jun 22, 2022
1 parent 5c783e9 commit 650f23d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions bin/cml/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ exports.handler = async (opts) => {
exports.builder = (yargs) =>
yargs.env('CML_PUBLISH').options(
kebabcaseKeys({
domain: {
type: 'string',
description: 'Self-Hosted domain',
default: 'asset.cml.dev',
hidden: true
},
md: {
type: 'boolean',
description: 'Output in markdown format [title || name](url).'
Expand Down
4 changes: 2 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ const fetchUploadData = async (opts) => {
};

const upload = async (opts) => {
const { path } = opts;
const endpoint = 'https://asset.cml.dev';
const { path, domain } = opts;
const endpoint = `https://${domain}`;

const { mime, size, data: body } = await fetchUploadData(opts);
const filename = path ? PATH.basename(path) : `file.${mime.split('/')[1]}`;
Expand Down

1 comment on commit 650f23d

@github-actions

This comment was marked as outdated.

Please sign in to comment.