File: ci.go

package info (click to toggle)
golang-github-pterm-pterm 0.12.79-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,640 kB
  • sloc: makefile: 4
file content (31 lines) | stat: -rw-r--r-- 714 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main

import (
	"os"
	"time"

	"atomicgo.dev/keyboard"
	"atomicgo.dev/keyboard/keys"
)

// ------ Automation for CI ------
// You can ignore this function, it is used to automatically run the demo and generate the example animation in our CI system.
func init() {
	if os.Getenv("CI") == "true" {
		go func() {
			time.Sleep(time.Second)
			keyboard.SimulateKeyPress(keys.Down)
			time.Sleep(time.Millisecond * 100)
			keyboard.SimulateKeyPress(keys.Space)

			time.Sleep(time.Millisecond * 300)

			keyboard.SimulateKeyPress(keys.Down)
			time.Sleep(time.Millisecond * 100)
			keyboard.SimulateKeyPress(keys.Space)

			time.Sleep(time.Millisecond * 300)
			keyboard.SimulateKeyPress(keys.Enter)
		}()
	}
}