mirror of
https://github.com/actions/configure-pages.git
synced 2026-04-04 00:32:22 +00:00
Add prettier configuration
This commit is contained in:
@@ -1,45 +1,46 @@
|
||||
const core = require('@actions/core')
|
||||
const axios = require('axios')
|
||||
const { ConfigParser } = require('./config-parser')
|
||||
const {ConfigParser} = require('./config-parser')
|
||||
|
||||
async function setPagesPath({staticSiteGenerator, path}) {
|
||||
try {
|
||||
switch(staticSiteGenerator)
|
||||
{
|
||||
switch (staticSiteGenerator) {
|
||||
case 'nuxt':
|
||||
var ssConfig = {
|
||||
filePath:"./nuxt.config.js",
|
||||
type: "nuxt",
|
||||
pathName: "router",
|
||||
subPathName: "base",
|
||||
filePath: './nuxt.config.js',
|
||||
type: 'nuxt',
|
||||
pathName: 'router',
|
||||
subPathName: 'base',
|
||||
newPath: path
|
||||
}
|
||||
break;
|
||||
break
|
||||
case 'next':
|
||||
var ssConfig = {
|
||||
filePath:"./next.config.js",
|
||||
type: "next",
|
||||
pathName: "basePath",
|
||||
filePath: './next.config.js',
|
||||
type: 'next',
|
||||
pathName: 'basePath',
|
||||
newPath: path
|
||||
}
|
||||
break;
|
||||
break
|
||||
case 'gatsby':
|
||||
var ssConfig = {
|
||||
filePath: "./gatsby-config.js",
|
||||
type: "gatsby",
|
||||
pathName: "pathPrefix",
|
||||
filePath: './gatsby-config.js',
|
||||
type: 'gatsby',
|
||||
pathName: 'pathPrefix',
|
||||
newPath: path
|
||||
}
|
||||
break;
|
||||
break
|
||||
default:
|
||||
throw "Unknown config type"
|
||||
throw 'Unknown config type'
|
||||
}
|
||||
|
||||
let configParser = new ConfigParser(ssConfig)
|
||||
configParser.parse()
|
||||
|
||||
} catch (error) {
|
||||
core.warning(`We were unable to determine how to inject the site metadata into your config. Generated URLs may be incorrect. The base URL for this site should be ${path}. Please ensure your framework is configured to generate relative links appropriately.`, error)
|
||||
core.warning(
|
||||
`We were unable to determine how to inject the site metadata into your config. Generated URLs may be incorrect. The base URL for this site should be ${path}. Please ensure your framework is configured to generate relative links appropriately.`,
|
||||
error
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user