Skip to content

Fix: Publish from a folder which is not root #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions lib/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,14 @@ async function preparePoetry(pluginConfig, nextRelease, logger) {
* @param root0.nextRelease
* @param root0.logger
*/
async function prepare(pluginConfig, { nextRelease, logger }) {
if (fs.existsSync('./setup.cfg')) {
await prepareSetupCfg(pluginConfig, nextRelease, logger)
} else if (fs.existsSync('./pyproject.toml')) {
await preparePoetry(pluginConfig, nextRelease, logger)
async function prepare(pluginConfig, { nextRelease, logger }) {
const setupPy = getOption(pluginConfig, 'setupPy');
if (fs.existsSync(setupPy)) {
if (path.basename(setupPy) === "setup.cfg") {
await prepareSetupCfg(pluginConfig, nextRelease, logger)
} else if (path.basename(setupPy) === "pyproject.toml") {
await preparePoetry(pluginConfig, nextRelease, logger)
}
} else {
const pypiPublish = getOption(pluginConfig, 'pypiPublish')
if (pypiPublish !== false) {
Expand Down
13 changes: 8 additions & 5 deletions lib/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,14 @@ async function publishPoetry(pluginConfig, logger) {
* @param root0.stdout
* @param root0.stderr
*/
async function publish(pluginConfig, { logger, stdout, stderr }) {
if (fs.existsSync('./setup.cfg')) {
await publishSetupCfg(pluginConfig, logger, stdout, stderr)
} else if (fs.existsSync('./pyproject.toml')) {
await publishPoetry(pluginConfig, logger)
async function publish(pluginConfig, { logger, stdout, stderr }) {
const setupPy = getOption(pluginConfig, 'setupPy');
if (fs.existsSync(setupPy)) {
if (path.basename(setupPy) === "setup.cfg") {
await publishSetupCfg(pluginConfig, logger, stdout, stderr)
} else if (path.basename(setupPy) === "pyproject.toml") {
await publishPoetry(pluginConfig, logger)
}
} else {
const pypiPublish = getOption(pluginConfig, 'pypiPublish')
if (pypiPublish !== false) {
Expand Down
13 changes: 8 additions & 5 deletions lib/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,14 @@ async function verifyPoetry(pluginConfig, logger) {
* @param root0
* @param root0.logger
*/
async function verify(pluginConfig, { logger }) {
if (fs.existsSync('./setup.cfg')) {
await verifySetupCfg(pluginConfig, logger)
} else if (fs.existsSync('./pyproject.toml')) {
await verifyPoetry(pluginConfig, logger)
async function verify(pluginConfig, { logger }) {
const setupPy = getOption(pluginConfig, 'setupPy');
if (fs.existsSync(setupPy)) {
if (path.basename(setupPy) === "setup.cfg") {
await verifySetupCfg(pluginConfig, logger)
} else if (path.basename(setupPy) === "pyproject.toml") {
await verifyPoetry(pluginConfig, logger)
}
} else {
const pypiPublish = getOption(pluginConfig, 'pypiPublish')
if (pypiPublish !== false) {
Expand Down