-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Loes Immens <[email protected]>
- Loading branch information
1 parent
1ebb49d
commit 59173dd
Showing
4 changed files
with
63 additions
and
4 deletions.
There are no files selected for viewing
5 changes: 2 additions & 3 deletions
5
...ication/src/main/kotlin/org/gxf/crestdevicesimulator/simulator/response/CommandService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
// SPDX-FileCopyrightText: Contributors to the GXF project | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package org.gxf.crestdevicesimulator.simulator.response | ||
|
||
import org.springframework.stereotype.Service | ||
|
||
@Service | ||
class CommandService { | ||
fun hasRebootCommand(command: String) = | ||
command.contains("CMD:REBOOT") | ||
// todo remove | ||
fun hasRebootCommand(command: String) = command.contains("CMD:REBOOT") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// SPDX-FileCopyrightText: Contributors to the GXF project | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
echo "*********************************************************" | ||
echo "Running git pre-commit hook. Running Spotless Apply... " | ||
echo "*********************************************************" | ||
|
||
# Gather the staged files - to make sure changes are saved only for these files. | ||
stagedFiles=$(git diff --staged --name-only) | ||
|
||
# run spotless apply | ||
./gradlew spotlessApply | ||
|
||
status=$? | ||
|
||
if [ "$status" = 0 ] ; then | ||
echo "Static analysis found no problems." | ||
# Add staged file changes to git | ||
for file in $stagedFiles; do | ||
if test -f "$file"; then | ||
git add $file | ||
fi | ||
done | ||
#Exit | ||
exit 0 | ||
else | ||
echo "*********************************************************" | ||
echo " ******************************************** " | ||
echo 1>&2 "Spotless Apply found violations it could not fix." | ||
echo "Run spotless apply in your terminal and fix the issues before trying to commit again." | ||
echo " ******************************************** " | ||
echo "*********************************************************" | ||
#Exit | ||
exit 1 | ||
fi |