Skip to content

Last line gets ignored when converting if the file doesn't end in a newline #11

@gtkacz

Description

@gtkacz

The last line of the Makefile will ofter get ignored when converting.

Step-by-step on how to replicate:

  1. pip install make-to-batch==0.2.3
  2. Create a Makefile containing:
build:
	docker-compose up --build

up:
	docker-compose up

This will generate a make.bat file with the following:

@echo off


IF /I "%1"=="build" GOTO build
IF /I "%1"=="up" GOTO up
GOTO error

:build
	docker-compose up --build
	GOTO :EOF

:up
	GOTO :EOF

:error
    IF "%1"=="" (
        ECHO make: *** No targets specified and no makefile found.  Stop.
    ) ELSE (
        ECHO make: *** No rule to make target '%1%'. Stop.
    )
    GOTO :EOF

Where the up command is empty.

  1. Alter the Makefile to have a newline below the last command, and the make.bat file is generated properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions